/* blmailo skin based on the Vexpax interface. Keep layout and behavior in styles.css. */
:root {
  color-scheme: dark;
  --bg: #090909;
  --surface: #111111;
  --surface-2: #171717;
  --surface-3: #242424;
  --line: #2e2e2e;
  --line-soft: #242424;
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --button-frame: #2e2e2e;
  --accent: #d4d4d4;
  --accent-hover: #f5f5f5;
  --accent-soft: rgba(255, 255, 255, .10);
  --vxp-highlight: #d4d4d4;
  --vxp-glow: rgba(255, 255, 255, .10);
  --vxp-selected: rgba(255, 255, 255, .08);
  --radius: 8px;
  font-family: Verdana, "Segoe UI", Roboto, Arial, sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f4f4;
  --surface: #ffffff;
  --surface-2: #f0f0f0;
  --surface-3: #e7e7e7;
  --line: #d5d5d5;
  --line-soft: #e1e1e1;
  --text: #171717;
  --muted: #666666;
  --button-frame: #d5d5d5;
  --accent: #595959;
  --accent-hover: #333333;
  --accent-soft: rgba(0, 0, 0, .08);
  --vxp-highlight: #595959;
  --vxp-glow: rgba(0, 0, 0, .09);
  --vxp-selected: rgba(0, 0, 0, .07);
}

/* Chromium uses the custom scrollbar below; Firefox gets its own thin variant. */
@supports (-moz-appearance: none) {
  *, *::before, *::after { scrollbar-width: thin; scrollbar-color: #777 transparent; }
}
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-color: var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--vxp-highlight); }

body, .auth-view, .mail-app, .mail-content { background: var(--bg); color: var(--text); }
button, input, textarea, select { font-family: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 1px solid var(--vxp-highlight);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--vxp-glow);
}
input:focus, textarea:focus, select:focus, .address-input:focus-within { transform: none; box-shadow: 0 0 0 1px var(--vxp-highlight), 0 5px 15px var(--vxp-glow); }

/* Sign in and registration */
.auth-view { background-image: radial-gradient(ellipse at 50% 0%, var(--surface-2), transparent 65%); }
.auth-shell, .modal, .settings-modal, .compose-window, .account-dialog, .language-dialog {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 68px rgba(0, 0, 0, .48);
}
.auth-shell { max-width: 480px; }
.auth-brand strong, .mail-brand strong, .auth-heading p, .modal-header p, .settings-header p, .panel-heading p { color: var(--vxp-highlight); }
.auth-tab { background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); border-radius: 8px; }
.auth-tab:hover, .auth-tab.active { background: var(--surface-3); border-color: var(--vxp-highlight); color: var(--text); box-shadow: 0 4px 16px var(--vxp-glow); }
.auth-tab.active::after { background: var(--vxp-highlight); }

/* Flat Vexpax controls */
.primary-button, .compose-button, .form-submit, .outline-button, .icon-button,
.bulk-action-button, .refresh-action-button, .settings-button, .account-switch,
.dialog-close, .language-select-button, .text-button, .attachment-button,
.copy-button, .share-image-options button {
  border: 1px solid var(--button-frame);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  box-shadow: none;
}
.primary-button:hover, .compose-button:hover, .form-submit:hover, .outline-button:hover,
.icon-button:hover, .bulk-action-button:hover, .refresh-action-button:hover,
.settings-button:hover, .account-switch:hover, .dialog-close:hover,
.language-select-button:hover, .text-button:hover, .attachment-button:hover,
.share-image-options button:hover {
  border-color: var(--vxp-highlight);
  background: var(--surface-3);
  color: var(--text);
  box-shadow: 0 5px 15px var(--vxp-glow);
  transform: translateY(-2px);
}
.primary-button:active, .compose-button:active, .outline-button:active, .icon-button:active { transform: translateY(1px) scale(.98); }

/* Mail shell and navigation */
.mail-header { background: #0d0d0d; border-bottom: 1px solid var(--line); box-shadow: none; }
html[data-theme="light"] .mail-header { background: #fff; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); }
.mail-search, .language-search { background: var(--surface-2); border-color: var(--line); }
.mail-search:focus-within, .language-search:focus-within, .address-input:focus-within {
  background: var(--surface-2);
  border-color: var(--vxp-highlight);
  box-shadow: 0 0 0 1px var(--vxp-highlight), 0 5px 15px var(--vxp-glow);
}
.mail-search button:hover { background: var(--surface-3); color: var(--text); }
.compose-button { justify-content: center; font-weight: 700; }
.folder-button, .settings-nav-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  box-shadow: none;
}
.folder-button:hover, .settings-nav-button:hover { border-color: var(--vxp-highlight); background: var(--surface-3); color: var(--text); box-shadow: 0 5px 15px var(--vxp-glow); }
.folder-button.active, .settings-nav-button.active { border-color: var(--vxp-highlight); background: var(--vxp-selected); color: var(--text); box-shadow: inset 2px 0 0 var(--vxp-highlight); }
.folder-button.active span, .settings-nav-button.active span { color: var(--text); }
.folder-button > .nav-sticker, .folder-button:nth-child(n) > .nav-sticker,
.settings-nav-button > .settings-sticker, .settings-nav-button:nth-child(n) > .settings-sticker {
  background: var(--vxp-selected);
  color: var(--vxp-highlight);
  border: 1px solid var(--line);
}
.folder-button em, .sidebar-account { color: var(--muted); }
.sidebar-account { border-color: var(--line); }

/* Inbox, conversations and composer */
.message-panel, .reader { background: var(--bg); border-color: var(--line); }
.list-toolbar, .reader-toolbar, .compose-header, .compose-footer { background: var(--surface); border-color: var(--line); }
.message-row, .message-row.unread { background: var(--surface); border-bottom: 1px solid var(--line-soft); }
.message-row.unread { background: var(--surface-2); }
.message-row:hover { background: var(--surface-3); box-shadow: inset 3px 0 0 var(--vxp-highlight); }
.star-button { color: var(--muted); }
.star-button:hover, .star-button.active { color: var(--vxp-highlight); }
.icon-button.active { border-color: var(--vxp-highlight); background: var(--vxp-selected); color: var(--text); }
.empty-state > span, .draft-sticker, .copy-success-sticker { background: var(--vxp-selected); border: 1px solid var(--line); color: var(--vxp-highlight); }
.reader-content, .thread-message, .thread-message.incoming, .thread-message.outgoing,
.conversation-thread, .reader-reply-bar, .attachment-preview, .image-preview-stage { background: var(--surface); border-color: var(--line); }
.thread-message.selected, .thread-message:hover { border-color: var(--vxp-highlight); box-shadow: 0 5px 15px var(--vxp-glow); transform: none; }
.compose-window:focus-within { border-color: var(--vxp-highlight); box-shadow: 0 22px 68px rgba(0, 0, 0, .48); }
.compose-window input, .compose-window textarea, .compose-recipient-field, .address-input { background: var(--surface); color: var(--text); border-color: var(--line); }
.compose-window input:focus, .compose-window textarea:focus { box-shadow: none; transform: none; }

/* Settings and secondary dialogs */
.settings-header, .modal-header { background: var(--surface); border-color: var(--line); }
.settings-nav { background: var(--surface); border-right: 1px solid var(--line); }
.settings-content, .settings-panel { background: var(--bg); }
.settings-panel .settings-form input, .settings-panel .settings-form select,
.settings-panel .settings-form textarea, .language-option, .device-item,
.security-block, .theme-preview, .sound-toggle, .function-index,
.settings-function, .embedded-settings-section, .profile-summary,
.account-switch, .account-dialog, .modal input, .modal select, .modal textarea {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--text);
  box-shadow: none;
}
.language-option:hover, .language-option.active, .device-item:hover, .security-block:hover,
.theme-preview:hover, .sound-toggle:hover, .settings-function:hover {
  border-color: var(--vxp-highlight);
  background: var(--surface-3);
  box-shadow: 0 5px 15px var(--vxp-glow);
}
.language-search:focus-within { border-color: var(--vxp-highlight); box-shadow: 0 0 0 1px var(--vxp-highlight), 0 5px 15px var(--vxp-glow); }
.settings-savebar { background: var(--surface); border-color: var(--line); }
.segmented-control { background: var(--surface-2); border-color: var(--line); }
.segmented-control button.active, .segmented-control input:checked + span { background: var(--surface-3); border-color: var(--vxp-highlight); color: var(--text); }
.toast { background: var(--surface-3); color: var(--text); border: 1px solid var(--vxp-highlight); box-shadow: 0 12px 28px rgba(0,0,0,.3); }

/* Small controls use the same lift and press motion as Vexpax. */
.auth-shell, .mail-header, .mail-content, .reader:not([hidden]), .empty-state:not([hidden]),
.settings-panel.active, .language-list, .device-list, .thread-message,
.account-switch, .device-item, .language-option, .security-block, .theme-preview,
.sound-toggle { animation: none; }
.avatar-button:hover img, .large-avatar:hover img, .small-avatar:hover img,
.sender-avatar:hover img, .mail-brand:hover img, .auth-brand:hover img { transform: none; }

.mail-header { grid-template-columns: minmax(145px, 200px) minmax(160px, 1fr) auto; gap: 16px; }
.header-actions { gap: 8px; }
.header-action,
.header-actions .settings-button,
.header-actions .avatar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-width: 38px;
  height: 38px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
  transition: transform .22s ease, background-color .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.header-action .lucide { width: 16px; height: 16px; flex: 0 0 auto; }
.header-actions .avatar-button #avatar-initial { width: 23px; height: 23px; background: var(--surface-3); }
.header-action:hover,
.header-action:focus-visible,
.header-actions .settings-button:hover,
.header-actions .avatar-button:hover {
  transform: translateY(-2px);
  background: var(--surface-3);
  border-color: var(--vxp-highlight);
  box-shadow: 0 0 12px var(--vxp-glow);
}
.header-action:active,
.header-actions .settings-button:active,
.header-actions .avatar-button:active { transform: scale(.96); box-shadow: 0 0 8px var(--vxp-glow); }
.bot-trap { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

button, input, textarea, select, .folder-button, .settings-nav-button, .language-option {
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease;
}
button:active { transform: translateY(1px) scale(.98); }
input:hover, textarea:hover, select:hover { border-color: var(--vxp-highlight); box-shadow: 0 0 0 1px var(--vxp-glow); }
input:focus, textarea:focus, select:focus, .address-input:focus-within { transform: translateY(-1px); }

/* Large blurred backdrops repeatedly repaint the full viewport while a dialog is open. */
.account-dialog::backdrop, .image-preview-dialog::backdrop,
.settings-modal::backdrop, .modal::backdrop, dialog[open]::backdrop { backdrop-filter: none; }
.account-dialog-header, .settings-savebar { backdrop-filter: none; }
.auth-shell, .modal, .settings-modal, .compose-window, .account-dialog, .language-dialog { box-shadow: 0 16px 42px rgba(0,0,0,.42); }

@media (max-width: 1180px) {
  .header-action span, .header-actions .settings-button span, .header-actions .avatar-button b { display: none; }
  .header-actions .avatar-button { padding: 6px; }
  .mail-header { grid-template-columns: minmax(130px, 180px) minmax(120px, 1fr) auto; }
}
@media (max-width: 760px) {
  .mobile-menu { width: 38px; min-width: 38px; height: 38px; padding: 8px; }
  .mobile-menu span { display: none; }
  .settings-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; overflow: visible; }
  .settings-nav-button { min-width: 0; width: 100%; padding: 6px 8px; }
}
@media (max-width: 600px) {
  .mail-header { grid-template-columns: auto minmax(72px, 1fr) auto; gap: 7px; padding-inline: 9px; }
  .header-actions { gap: 4px; }
  .header-action, .header-actions .settings-button, .header-actions .avatar-button { min-width: 33px; width: 33px; height: 34px; padding: 5px; }
  .header-action .lucide { width: 15px; height: 15px; }
  .header-actions .avatar-button #avatar-initial { width: 22px; height: 22px; }
}

@media (max-width: 760px) {
  .mail-header { background: var(--surface); }
  .sidebar { box-shadow: 14px 0 35px rgba(0,0,0,.35); }
  .settings-layout { background: var(--bg); }
}

/* Vexpax interaction states. The control stays in place on hover, so its
   visual edge and pointer hit area always line up. */
:root {
  --vxp-neon: 0 0 0 1px var(--vxp-highlight),
    0 0 18px rgba(255, 255, 255, .18),
    0 5px 15px rgba(255, 255, 255, .10);
  --vxp-neon-focus: 0 0 0 1px var(--vxp-highlight),
    0 0 0 4px rgba(255, 255, 255, .07),
    0 0 22px rgba(255, 255, 255, .20);
  --vxp-motion: cubic-bezier(.2, .8, .2, 1);
}
html[data-theme="light"] {
  --vxp-neon: 0 0 0 1px var(--vxp-highlight),
    0 5px 15px rgba(0, 0, 0, .12);
  --vxp-neon-focus: 0 0 0 1px var(--vxp-highlight),
    0 0 0 4px rgba(0, 0, 0, .06),
    0 5px 15px rgba(0, 0, 0, .12);
}

button:not(:disabled),
.header-actions .settings-button, .header-actions .avatar-button,
.language-option, .device-item, .security-block, .theme-preview,
.sound-toggle, .settings-function, .thread-message, .message-row {
  transition: color .28s ease, background-color .28s ease,
    border-color .28s ease, box-shadow .34s var(--vxp-motion),
    transform .22s var(--vxp-motion), filter .28s ease;
}
button:not(:disabled):hover,
.header-action:hover,
.header-actions .settings-button:hover,
.header-actions .avatar-button:hover,
.language-option:hover, .device-item:hover, .security-block:hover,
.theme-preview:hover, .sound-toggle:hover, .settings-function:hover {
  transform: none;
  filter: none;
  border-color: var(--vxp-highlight);
  box-shadow: var(--vxp-neon);
}
button:not(:disabled):active,
.header-action:active,
.header-actions .settings-button:active,
.header-actions .avatar-button:active {
  transform: translateY(1px) scale(.98);
  box-shadow: 0 0 0 1px var(--vxp-highlight), 0 0 10px var(--vxp-glow);
}
button:focus-visible,
.header-action:focus-visible,
.header-actions .settings-button:focus-visible,
.header-actions .avatar-button:focus-visible {
  outline: 1px solid var(--vxp-highlight);
  outline-offset: 3px;
  box-shadow: var(--vxp-neon-focus);
}
label:hover .lucide { transform: none; }

:is(.auth-form, .settings-form, .logout-options, .compose-window,
  .modal, .account-dialog, .language-dialog, .mail-app)
  :is(input:not(:where([type="checkbox"], [type="radio"], [type="file"],
    [type="hidden"], [type="color"], [type="range"])), textarea, select),
.mail-search, .language-search, .address-input, .compose-recipient-field {
  border-radius: 10px;
  transition: color .28s ease, background-color .28s ease,
    border-color .28s ease, box-shadow .34s var(--vxp-motion),
    transform .22s var(--vxp-motion);
}
:is(.auth-form, .settings-form, .logout-options, .compose-window,
  .modal, .account-dialog, .language-dialog, .mail-app)
  :is(input:not(:where([type="checkbox"], [type="radio"], [type="file"],
    [type="hidden"], [type="color"], [type="range"])), textarea, select):hover,
.mail-search:hover, .language-search:hover, .address-input:hover,
.compose-recipient-field:hover {
  transform: none;
  border-color: var(--vxp-highlight);
  box-shadow: var(--vxp-neon);
}
:is(.auth-form, .settings-form, .logout-options, .compose-window,
  .modal, .account-dialog, .language-dialog, .mail-app)
  :is(input:not(:where([type="checkbox"], [type="radio"], [type="file"],
    [type="hidden"], [type="color"], [type="range"])), textarea, select):focus,
.mail-search:focus-within, .language-search:focus-within,
.address-input:focus-within, .compose-recipient-field:focus-within {
  transform: none;
  border-color: var(--vxp-highlight);
  box-shadow: var(--vxp-neon-focus);
}
:is(.auth-form, .settings-form, .logout-options, .compose-window,
  .modal, .account-dialog, .language-dialog, .mail-app)
  :is(input:not(:where([type="checkbox"], [type="radio"], [type="file"],
    [type="hidden"], [type="color"], [type="range"])), textarea, select):active {
  transform: none;
  box-shadow: var(--vxp-neon-focus);
}
/* Search and address controls draw their ring on the shared outer field. */
.mail-app .mail-search input:is(:hover, :focus, :active),
.mail-app .language-search input:is(:hover, :focus, :active),
.auth-form .address-input input:is(:hover, :focus, :active),
.mail-app .address-input input:is(:hover, :focus, :active),
.mail-app .compose-recipient-field input:is(:hover, :focus, :active) {
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

/* Shared top bar: the brand sits directly above the sidebar. */
.mail-header {
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 0;
  padding: 0 18px 0 0;
}
.header-brand-block {
  height: 100%;
  padding-left: 18px;
  border-right: 1px solid var(--line);
}
.header-actions {
  width: 100%;
  min-width: 0;
  justify-self: stretch;
  gap: 8px;
  padding-left: 20px;
}
.header-actions #settings-button { width: 126px; margin-right: auto; }
.header-actions #header-language { width: 96px; gap: 5px; padding: 8px 7px; }
.header-actions #header-integrations { width: 142px; }
.header-actions #avatar-button { width: 126px; }
.header-actions .header-action { flex: 0 0 auto; white-space: nowrap; }
.header-actions .header-action span:not(#avatar-initial),
.header-actions .avatar-button b { overflow: hidden; text-overflow: ellipsis; }
.header-actions #header-language-code { display: inline; min-width: 24px; flex: 0 0 auto; text-align: center; }
.header-actions #header-language .language-chevron { width: 12px; height: 12px; }

/* All transient notices use the compact, centered Vexpax card. */
.toast,
.toast.visible {
  right: auto;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  width: max-content;
  max-width: calc(100vw - 28px);
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .48);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  animation: none;
  transition: opacity .32s ease, transform .32s cubic-bezier(.2, .8, .2, 1), border-color .24s ease, box-shadow .24s ease;
}
.toast {
  opacity: 0;
  transform: translate(-50%, calc(100% + max(28px, env(safe-area-inset-bottom))));
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

dialog[open]:not(.dialog-exiting) {
  animation: blmailo-dialog-in .22s cubic-bezier(.2, .8, .2, 1) both;
}
dialog[open].dialog-exiting {
  pointer-events: none;
  animation: blmailo-dialog-out .18s ease-in both;
}
dialog[open].dialog-exiting::backdrop {
  animation: blmailo-backdrop-out .18s ease-in both;
}
@keyframes blmailo-dialog-in {
  from { opacity: 0; transform: translateY(48px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes blmailo-dialog-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(48px); }
}
@keyframes blmailo-backdrop-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
.compose-window {
  transform: translate(-50%, calc(-50% + 48px));
  transition: opacity .2s ease, transform .2s cubic-bezier(.2, .8, .2, 1);
}
.compose-window.open { transform: translate(-50%, -50%); }
@media (prefers-reduced-motion: reduce) {
  dialog[open]:not(.dialog-exiting), dialog[open].dialog-exiting,
  dialog[open].dialog-exiting::backdrop { animation: none; }
  .compose-window { transition: none; }
}

/* Navigation keeps the hovered appearance after selection. */
.folder-button:hover, .folder-button.active,
.settings-nav-button:hover, .settings-nav-button.active {
  border-color: var(--vxp-highlight);
  background: var(--surface-3);
  color: var(--text);
  box-shadow: var(--vxp-neon);
}
.folder-button.active span, .settings-nav-button.active span { color: var(--text); }
.folder-button, .settings-nav-button { transition: background-color .28s ease, border-color .28s ease, color .28s ease, box-shadow .34s var(--vxp-motion); }
.folder-button .nav-sticker, .settings-nav-button .settings-sticker,
.folder-button .nav-sticker .lucide, .settings-nav-button .settings-sticker .lucide {
  transform: none !important;
  transition: background-color .28s ease, border-color .28s ease, color .28s ease;
}
.mail-content .message-panel {
  transition: opacity .2s ease, transform .2s cubic-bezier(.2, .8, .2, 1);
}
.mail-content.folder-switching .message-panel { opacity: 0; }
.mail-content.folder-switching[data-folder-direction="down"] .message-panel { transform: translateY(-16px); }
.mail-content.folder-switching[data-folder-direction="up"] .message-panel { transform: translateY(16px); }
.mail-content.folder-entering .message-panel { opacity: 0; transition: none; }
.mail-content.folder-entering[data-folder-direction="down"] .message-panel { transform: translateY(16px); }
.mail-content.folder-entering[data-folder-direction="up"] .message-panel { transform: translateY(-16px); }
@media (prefers-reduced-motion: reduce) {
  .mail-content .message-panel { transition: none; }
  .mail-content.folder-switching .message-panel,
  .mail-content.folder-entering .message-panel { transform: none; }
}

/* Pressing draws a larger neon rim without changing control geometry. */
button:hover:not(:disabled), button:active:not(:disabled),
.header-actions .header-action:hover, .header-actions .header-action:active,
.folder-button.active, .settings-nav-button.active,
.language-option:hover, .language-option:active,
.message-row:hover, .thread-message:hover {
  transform: none !important;
}
button:active:not(:disabled), .header-actions .header-action:active {
  border-color: var(--vxp-highlight);
  box-shadow: 0 0 0 2px var(--vxp-highlight),
    0 0 0 5px rgba(255, 255, 255, .07),
    0 0 22px rgba(255, 255, 255, .22);
}
button:hover:not(:disabled) .lucide,
a:hover .lucide, label:hover .lucide,
.mail-brand:hover span, .auth-brand:hover span,
.mail-brand:hover img, .auth-brand:hover img,
.mail-checkbox:hover span, .mail-checkbox input:focus-visible + span {
  transform: none !important;
}
.mail-brand:hover span, .auth-brand:hover span { letter-spacing: normal; }

/* Small square close controls match the reference dialog. */
.dialog-close, .compose-header #close-compose {
  display: inline-flex;
  width: 32px;
  min-width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  box-shadow: none;
}
.dialog-close .lucide, .compose-header #close-compose .lucide { width: 15px; height: 15px; }
.dialog-close:hover, .compose-header #close-compose:hover {
  border-color: var(--vxp-highlight);
  background: var(--surface-3);
  color: var(--text);
  box-shadow: var(--vxp-neon);
}

.integrations-dialog { width: min(500px, calc(100vw - 24px)); }
.integrations-content { display: grid; gap: 16px; padding: 24px; }
.integrations-content p { margin: 0; color: var(--text); line-height: 1.55; }
.integrations-content small { color: var(--muted); line-height: 1.5; }
.integration-address {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.integration-address > span { min-width: 0; overflow-wrap: anywhere; }
.integration-address button { justify-self: start; display: inline-flex; align-items: center; gap: 7px; }
.integration-address button .lucide { width: 15px; height: 15px; }

@media (min-width: 921px) {
  .header-actions .header-action span, .header-actions .settings-button span,
  .header-actions .avatar-button b { display: inline; }
}
@media (max-width: 920px) {
  .mail-header { grid-template-columns: 210px minmax(0, 1fr); }
  .header-actions .header-action span:not(#header-language-code):not(#avatar-initial),
  .header-actions .settings-button span, .header-actions .avatar-button b { display: none; }
  .header-actions :is(#settings-button, #header-integrations, #avatar-button) { width: 38px; min-width: 38px; }
  .header-actions #header-language { width: 64px; }
  .header-actions #header-language .language-chevron { display: none; }
}
@media (max-width: 760px) {
  .mail-header { grid-template-columns: auto minmax(0, 1fr); gap: 8px; padding: 0 9px; }
  .header-brand-block { padding-left: 0; padding-right: 8px; border-right: 0; }
  .header-brand-block .mail-brand { display: inline-flex; }
  .header-brand-block .mail-brand span { display: none; }
  .header-actions { justify-content: flex-end; gap: 4px; padding-left: 0; }
  .header-actions #settings-button { margin-right: auto; }
  .header-actions :is(#settings-button, #header-integrations, #avatar-button) { width: 34px; min-width: 34px; padding: 5px; }
  .header-actions #header-language { width: 54px; min-width: 54px; padding: 5px 3px; gap: 3px; }
  .header-actions #header-language .language-chevron { display: none; }
}
@media (max-width: 480px) {
  .integration-address { align-items: stretch; flex-direction: column; }
}

/* Compact header menus. */
.header-menu-group { position: relative; flex: 0 0 auto; }
.header-actions #header-donate { width: 112px; }
.header-actions #header-faq { width: 96px; }
.header-actions :is(#header-donate, #header-faq)[aria-expanded="true"],
.header-actions #header-language[aria-expanded="true"] {
  border-color: var(--vxp-highlight);
  background: var(--surface-3);
  box-shadow: var(--vxp-neon);
}
.header-dropdown {
  position: absolute;
  z-index: 110;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  width: max-content;
  min-width: 204px;
  gap: 5px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .5);
}
.header-dropdown[hidden] { display: none; }
.header-dropdown:not([hidden]):not(.is-closing) {
  animation: header-dropdown-in .2s cubic-bezier(.2, .8, .2, 1) both;
}
.header-dropdown.is-closing {
  z-index: 109;
  pointer-events: none;
  animation: header-dropdown-out .16s ease-in both;
}
@keyframes header-dropdown-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes header-dropdown-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}
@media (prefers-reduced-motion: reduce) {
  .header-dropdown:not([hidden]):not(.is-closing),
  .header-dropdown.is-closing { animation: none; }
}
.header-dropdown p { margin: 2px 6px 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
.header-dropdown button {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}
.header-dropdown button:hover { background: var(--surface-3); border-color: var(--vxp-highlight); }
.faq-menu { right: 0; left: auto; width: 320px; min-width: 270px; max-width: calc(100vw - 16px); }
.faq-menu button { display: flex; align-items: center; gap: 10px; min-width: 0; }
.faq-menu button > .lucide { width: 20px !important; height: 20px !important; flex: 0 0 20px; padding: 0 !important; color: var(--muted); }
.faq-menu button > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.donation-dialog {
  position: fixed;
  width: min(400px, calc(100vw - 28px));
  padding: 0;
  border-radius: 12px;
}
.donation-dialog h2 { margin: 0; font-size: 24px; line-height: 1.15; }
.donation-dialog p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.donation-content { padding: 20px 25px 25px; }
.donation-address {
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
  user-select: text;
}
.donation-copy {
  display: inline-flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 700;
}
.donation-copy .lucide { width: 15px; height: 15px; }

/* The language picker follows the header control instead of dimming the page. */
.language-dialog.anchored {
  position: fixed;
  z-index: 120;
  width: 230px;
  max-width: calc(100vw - 16px);
  max-height: 390px;
  margin: 0;
  padding: 7px;
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .5);
}
.language-dialog.anchored .modal-header { display: none; }
.language-dialog.anchored .language-search {
  height: 38px;
  margin: 0 0 8px;
  padding: 0 9px;
  border-radius: 9px;
  background: var(--surface);
}
.language-dialog.anchored .language-search input,
.language-dialog.anchored .language-search input:is(:hover, :focus, :active) {
  min-height: 36px;
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  transform: none;
  font-size: 12px;
}
.language-dialog.anchored .language-list {
  max-height: 320px;
  gap: 5px;
  padding: 0;
}
.language-dialog.anchored .language-option {
  min-height: 36px;
  grid-template-columns: 24px minmax(0, 1fr) 25px;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font-size: 12px;
}
.language-option { grid-template-columns: 28px minmax(0, 1fr) 34px; gap: 9px; }
.language-option-flag {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 22px;
  line-height: 1;
  white-space: nowrap;
}
.language-option-flag img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.auth-info { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.55; }
.auth-info p { margin: 0 0 12px; color: var(--muted); }
.auth-info a { display: inline-block; margin-right: 15px; color: var(--text); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.auth-info a:hover { text-decoration-color: currentColor; }
.language-dialog.anchored .language-option-flag { width: 24px; height: 24px; font-size: 19px; }
.language-option-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.language-option-code { color: var(--muted); font-size: 11px; font-weight: 700; text-align: right; }
.language-dialog.anchored .language-option:is(:hover, .active) {
  border-color: var(--vxp-highlight);
  background: var(--surface-3);
  box-shadow: var(--vxp-neon);
}

/* One hover surface per message; the star only changes its own stroke. */
.message-row:hover, .message-row.selected {
  background: var(--surface-3);
  box-shadow: none !important;
}
.message-row .message-open:is(:hover, :focus, :active),
.message-row .star-button:is(:hover, :focus, :active) {
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.message-row .star-button:hover { color: var(--vxp-highlight); }
.message-row .star-button:hover .lucide {
  fill: none;
  stroke: var(--vxp-highlight);
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, .48));
}
.message-row .star-button.active:hover .lucide { fill: currentColor; }

@media (max-width: 920px) {
  .header-actions :is(#header-donate, #header-faq) { width: 38px; min-width: 38px; }
}
@media (max-width: 760px) {
  .header-actions :is(#header-donate, #header-faq) { width: 34px; min-width: 34px; padding: 5px; }
  .faq-menu { right: auto; left: 0; }
}
@media (max-width: 360px) {
  .header-brand-block .mail-brand { display: none; }
}

/* Dialog titles form a separate top bar with one consistent divider. */
.compose-header, .modal-header, .settings-header,
.account-dialog-header, .image-preview-header {
  background: var(--surface-2);
  border-bottom: 1px solid color-mix(in srgb, var(--text) 22%, transparent);
}
.dialog-title-container, .dialog-title { min-width: 0; }
.dialog-title-container { flex: 1 1 auto; }
.dialog-title {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 10px;
}
.dialog-title-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
.dialog-title-icon > svg, .dialog-title-icon > .lucide {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}
.dialog-title h2, .dialog-title strong { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.modal-header > .dialog-close, .settings-header > .dialog-close,
.account-dialog-header > .dialog-close, .image-preview-header > .dialog-close,
.compose-header > #close-compose { flex: 0 0 auto; margin-left: 12px; }
.compose-header { min-height: 58px; padding: 0 18px; font-size: 16px; }
.compose-header strong { font-size: 16px; }
.compose-header #close-compose { border-radius: 9px; }
.donation-header { min-height: 72px; padding: 17px 25px; }

/* The composer paints one stable layer while only the fields receive focus styling. */
.compose-window {
  height: min(610px, calc(100dvh - 72px));
  grid-template-rows: 58px minmax(0, 1fr);
  overflow: hidden;
  will-change: transform, opacity;
}
.compose-window:focus-within {
  border-color: var(--line);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .42);
}
.compose-window form {
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto auto;
}
.compose-fields {
  display: grid;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
}
.compose-window .compose-field {
  display: flex;
  align-items: stretch;
  min-width: 0;
  min-height: 66px;
  flex-direction: column;
  gap: 5px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.compose-window .compose-field:hover,
.compose-window .compose-field:focus-within {
  border-color: var(--vxp-highlight);
  background: var(--surface-3);
  box-shadow: 0 0 0 1px var(--vxp-glow);
}
.compose-window .compose-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.compose-window .compose-field :is(input, textarea),
.compose-window .compose-field :is(input, textarea):is(:hover, :focus, :active) {
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: 0;
  transform: none;
  font-size: 13px;
}
.compose-window .compose-field input { height: 27px; }
.compose-window .compose-body-field { min-height: 0; }
.compose-window .compose-body-field textarea { height: 100%; flex: 1; resize: none; }
.compose-footer {
  min-height: 72px;
  gap: 8px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.compose-primary-actions { display: flex; flex: 1; flex-wrap: wrap; gap: 8px; }
.compose-footer .compose-action {
  display: inline-flex;
  width: auto;
  min-width: 0;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.compose-footer .compose-action:hover {
  border-color: var(--vxp-highlight);
  background: var(--surface-3);
  box-shadow: var(--vxp-neon);
}
.compose-footer .compose-action-sticker {
  display: inline-grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--vxp-selected);
}
.compose-footer .compose-action-sticker .lucide { width: 15px; height: 15px; }
.compose-footer .compose-discard { margin-left: auto; }
@media (max-width: 640px) {
  .compose-window { height: min(620px, calc(100dvh - 24px)); }
  .compose-footer { align-items: stretch; }
  .compose-primary-actions { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compose-primary-actions .attachment-button { grid-column: 1 / -1; }
  .compose-footer .compose-action { width: 100%; }
  .compose-footer .compose-discard { margin-left: 0; }
}

/* Keep the attachment label level with the surrounding buttons. */
.compose-primary-actions > .attachment-button.compose-action {
  align-self: center;
  height: 42px;
  margin: 0;
  padding: 5px 10px 5px 6px;
  line-height: 1;
  vertical-align: middle;
  transform: none !important;
}
.compose-primary-actions > .attachment-button.compose-action:hover,
.compose-primary-actions > .attachment-button.compose-action:active {
  transform: none !important;
}
.compose-primary-actions > .attachment-button.compose-action .lucide {
  transform: none !important;
}
.compose-window .compose-field:hover,
.compose-window .compose-field:focus-within {
  border-color: var(--vxp-highlight);
  background: var(--surface-2);
  box-shadow: none;
}
.modal { scrollbar-gutter: auto; }
.permanent-delete-content > div { justify-content: center; }
.folder-button.active, .folder-button.active:hover {
  border: 1px solid var(--vxp-highlight);
  background: var(--surface-3);
  box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 0 10px rgba(255,255,255,.07);
}
.folder-button.active .nav-sticker { border-color: var(--vxp-highlight); }
.bulk-actions > #selected-message-count { display: inline-block; min-width: max-content; white-space: nowrap; text-align: left; }
button:has(> .button-sticker) { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.button-sticker {
  display: inline-grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--vxp-selected);
  color: var(--text);
}
.button-sticker .lucide { width: 14px; height: 14px; transform: none !important; }
button:not(.dialog-close):not(#close-compose):not(.star-button):not(.message-open):not(.folder-button):not(.bulk-action-button):not(.compose-action):not(.settings-nav-button):not(.popover-action) > .lucide:first-child {
  width: 26px;
  height: 26px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--vxp-selected);
  box-sizing: border-box;
}
.dialog-close > .lucide:first-child,
.star-button > .lucide:first-child,
#close-compose > .lucide:first-child { width: 16px; height: 16px; padding: 0; border: 0; background: none; }
.header-actions .header-action { gap: 4px; padding: 6px 7px; }
.header-actions .header-action > .lucide:first-child { width: 21px; height: 21px; padding: 3px; }

/* Scrollbars have a thumb and track only, including the language picker. */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-button,
::-webkit-scrollbar-button:single-button,
::-webkit-scrollbar-button:start,
::-webkit-scrollbar-button:end { display: none !important; width: 0 !important; height: 0 !important; }
::-webkit-scrollbar-corner { background: transparent; }

/* Icons remain bare inside controls. */
.button-sticker,
.compose-footer .compose-action-sticker,
.folder-button > .nav-sticker,
.folder-button:nth-child(n) > .nav-sticker,
.settings-nav-button > .settings-sticker,
.settings-nav-button:nth-child(n) > .settings-sticker,
.popover-action > .action-sticker,
.account-dialog .popover-action > .action-sticker {
  border: 0;
  background: transparent;
  box-shadow: none;
}
button:not(.dialog-close):not(#close-compose):not(.star-button):not(.message-open):not(.folder-button):not(.bulk-action-button):not(.compose-action):not(.settings-nav-button):not(.popover-action) > .lucide:first-child {
  border: 0;
  background: transparent;
}
.header-dropdown button > .button-sticker { display: none; }

/* The send button uses the same visible interaction as its neighbours. */
.compose-footer button.primary-button.compose-action {
  background: var(--surface-2);
  border-color: var(--button-frame);
  color: var(--text);
}
.compose-footer button.primary-button.compose-action:hover {
  background: var(--surface-3);
  border-color: var(--vxp-highlight);
  box-shadow: var(--vxp-neon);
  transform: none;
}
.compose-footer button.primary-button.compose-action:active {
  transform: none;
  box-shadow: 0 0 0 2px var(--vxp-highlight), 0 0 14px var(--vxp-glow);
}

/* Profile: current account and actions at left, connected account list at right. */
.account-dialog { width: min(850px, calc(100% - 30px)); }
.account-dialog-content {
  grid-template-columns: minmax(0, 1fr) minmax(260px, .82fr);
  gap: 0;
  padding: 0;
}
.account-main-column { display: grid; align-content: start; gap: 18px; padding: 20px 22px 22px; }
.account-list-section {
  align-content: start;
  gap: 13px;
  min-width: 0;
  padding: 22px 18px;
  border-left: 1px solid var(--line);
  background: var(--surface-2);
}
.account-list { max-height: min(56vh, 430px); gap: 8px; }
.account-list::-webkit-scrollbar { display: block; }
.account-list-row { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 6px; min-width: 0; }
.account-list-row .account-switch { min-width: 0; padding: 8px; gap: 8px; }
.account-list-row .account-switch:disabled { opacity: 1; cursor: default; border-color: var(--vxp-highlight); }
.account-list-row .small-avatar { flex: 0 0 32px; width: 32px; height: 32px; }
.account-list-row .account-switch > span:nth-child(2) { flex: 1; }
.account-list-row .account-current-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  margin-left: auto;
  color: var(--success) !important;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.account-list-logout {
  display: grid;
  width: 38px;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.account-list-logout .lucide { width: 17px; height: 17px; }
.account-list-logout:hover { color: #ff8791; }
@media (max-width: 700px) {
  .account-dialog { width: calc(100% - 20px); }
  .account-dialog-content { grid-template-columns: minmax(0, 1fr); }
  .account-main-column { padding: 16px; }
  .account-list-section { border-left: 0; border-top: 1px solid var(--line); padding: 16px; }
}

/* Compose controls share timing and do not select label text on touch. */
.compose-footer .compose-action,
.compose-primary-actions > .attachment-button.compose-action {
  user-select: none;
  -webkit-user-select: none;
  transition: color .28s ease, background-color .28s ease,
    border-color .28s ease, box-shadow .34s var(--vxp-motion),
    transform .22s var(--vxp-motion);
}
.compose-primary-actions > .attachment-button.compose-action:hover {
  border-color: var(--vxp-highlight);
  background: var(--surface-3);
  box-shadow: var(--vxp-neon);
}
.compose-primary-actions > .attachment-button.compose-action:active {
  box-shadow: 0 0 0 2px var(--vxp-highlight), 0 0 14px var(--vxp-glow);
}

/* Account rows retain their dimensions while their border changes. */
.account-list-row { height: 58px; }
.account-list-row .account-switch,
.account-list-row .account-list-logout { height: 58px; min-height: 58px; }
.account-list-row .account-switch:hover:not(:disabled),
.account-list-row .account-list-logout:hover {
  transform: none;
  background: var(--surface-3);
  border-color: var(--vxp-highlight);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 0 10px var(--vxp-glow);
}
.account-list-row .account-switch:active,
.account-list-row .account-list-logout:active { transform: none; }
.account-list-row .account-switch:disabled:hover { transform: none; box-shadow: none; }
.account-list { grid-template-columns: minmax(0, 1fr); overflow-x: hidden; }
.account-list-row .account-switch { overflow: hidden; }
.account-list-row .account-switch > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.account-list-row .account-switch > .account-current-badge {
  display: inline-flex;
  min-width: max-content;
  flex: 0 0 auto;
  align-items: center;
  margin-left: auto;
}

/* Menus stay inside the phone viewport. */
@media (max-width: 760px) {
  .list-toolbar-primary > div { display: block; }
  .list-toolbar h1 { font-size: 17px; }
  .list-toolbar > div > span { font-size: 11px; }
  .header-dropdown,
  .faq-menu {
    position: fixed;
    top: calc(var(--header-height) + 6px);
    left: 8px;
    right: 8px;
    width: auto;
    min-width: 0;
    max-height: min(65dvh, 430px);
    overflow-y: auto;
  }
  .language-dialog.anchored {
    display: flex;
    flex-direction: column;
    width: min(310px, calc(100vw - 16px));
    max-height: calc(100dvh - var(--header-height) - 16px);
    overflow: hidden;
  }
  .language-dialog.anchored .language-search { flex: 0 0 38px; }
  .language-dialog.anchored .language-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
  .compose-window {
    top: 50%;
    max-height: calc(100dvh - 20px);
  }
}

/* Touchscreens show feedback only while a control is pressed. */
@media (hover: none), (pointer: coarse) {
  button:hover:not(:active):not(.active),
  .header-action:hover:not(:active),
  .account-switch:hover:not(:active),
  .language-option:hover:not(:active):not(.active),
  .attachment-button:hover:not(:active) {
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
  }
  .compose-primary-actions > .attachment-button.compose-action:hover:not(:active),
  .compose-footer .compose-action:hover:not(:active),
  .header-dropdown button:hover:not(:active),
  .account-list-row .account-switch:hover:not(:active):not(:disabled),
  .account-list-row .account-list-logout:hover:not(:active) {
    background: var(--surface-2);
    border-color: var(--button-frame);
    box-shadow: none;
  }
  .account-list-row .account-switch:disabled:hover { border-color: var(--vxp-highlight); }
  button:active,
  .compose-primary-actions > .attachment-button.compose-action:active,
  .language-option:active,
  .header-dropdown button:active {
    transform: none !important;
    border-color: #fff !important;
    box-shadow: 0 0 0 1px #fff, 0 0 12px rgba(255,255,255,.16) !important;
  }
}

/* Real touch events also cover browsers that keep :hover after a tap. */
html.touch-input button,
html.touch-input .attachment-button,
html.touch-input input,
html.touch-input textarea,
html.touch-input select {
  transition-property: color, background-color, border-color, opacity !important;
  transition-duration: .12s !important;
}
html.touch-input button:hover:not(:active):not(.active):not(:disabled):not(.star-button):not(.message-open),
html.touch-input .attachment-button:hover:not(:active) {
  transform: none !important;
  filter: none !important;
  background: var(--surface-2) !important;
  border-color: var(--button-frame) !important;
  box-shadow: none !important;
}
html.touch-input :is(button, .attachment-button):hover .lucide {
  transform: none !important;
}
html.touch-input :is(.bulk-action-button, .refresh-action-button):hover:not(:active) {
  background: transparent !important;
}
html.touch-input button:focus:not(:active),
html.touch-input button:focus-visible:not(:active),
html.touch-input .header-action[aria-expanded="true"],
html.touch-input :is(.folder-button, .settings-nav-button, .language-option).active {
  outline: none !important;
  box-shadow: none !important;
}
html.touch-input :is(button, .attachment-button):active {
  transform: none !important;
  border-color: #fff !important;
  box-shadow: 0 0 0 1px #fff !important;
}
html.touch-input :is(input, textarea, select):hover,
html.touch-input :is(input, textarea, select):focus,
html.touch-input :is(input, textarea, select):focus-visible,
html.touch-input :is(.compose-field, .address-input, .language-search, .mail-search):hover,
html.touch-input :is(.compose-field, .address-input, .language-search, .mail-search):focus-within {
  outline: none !important;
  transform: none !important;
  box-shadow: none !important;
}
html.touch-input :is(input, textarea, select):focus,
html.touch-input :is(.compose-field, .address-input, .language-search, .mail-search):focus-within {
  border-color: var(--vxp-highlight);
}

/* Plain narrow scroll indicator throughout the interface. */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track,
::-webkit-scrollbar-track-piece { background: transparent; border: 0; box-shadow: none; }
::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb:hover {
  background: #929292;
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
  box-shadow: none;
}
::-webkit-scrollbar-button,
::-webkit-scrollbar-button:single-button,
::-webkit-scrollbar-button:start,
::-webkit-scrollbar-button:end {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
::-webkit-scrollbar-corner { background: transparent; }
.account-dialog-content::-webkit-scrollbar,
.account-list::-webkit-scrollbar { display: block; width: 9px; }

.language-list,
.language-dialog.anchored .language-list { scrollbar-gutter: auto; }

/* Fade folder content without moving the text across subpixels. */
.mail-content .message-panel { transition: opacity .22s ease; transform: none !important; }
.mail-content.folder-switching .message-panel,
.mail-content.folder-entering .message-panel { opacity: 0; }

.compose-window textarea { caret-color: var(--text); }

.donate-menu button { display: flex; align-items: center; gap: 9px; }
.donate-menu button svg { width: 20px; height: 20px; flex: 0 0 20px; color: var(--muted); }

.faq-dialog {
  width: min(460px, calc(100vw - 28px));
  max-height: min(80dvh, 680px);
  padding: 0;
  border-radius: 12px;
}
.faq-dialog .modal-header { gap: 12px; }
.faq-dialog h2 { margin: 0; font-size: 21px; line-height: 1.3; }
.faq-content { padding: 18px 24px 24px; overflow-y: auto; }
.faq-content p { margin: 0 0 13px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.faq-content p:last-child { margin-bottom: 0; }
.faq-content .faq-byline { margin-bottom: 4px; color: var(--text); }
.faq-content .faq-byline + p:not(.faq-byline) { margin-top: 16px; }
.faq-content strong { color: var(--text); }
.faq-value {
  padding: 13px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
  user-select: text;
}
.faq-action {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 700;
}
.faq-action .lucide { width: 15px; height: 15px; }

/* Settings use the same stationary controls and card rhythm as the mail view. */
.settings-modal { border-radius: 12px; }
.settings-nav { gap: 8px; padding: 16px 12px; }
.settings-nav-button {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  box-shadow: none;
  transform: none !important;
  transition: background-color .28s ease, border-color .28s ease,
    color .28s ease, box-shadow .28s ease;
}
.settings-nav-button > .settings-sticker {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: currentColor;
}
.settings-nav-button:hover,
.settings-nav-button.active,
.settings-nav-button.active:hover {
  background: var(--surface-3);
  border-color: var(--vxp-highlight);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(255,255,255,.09), 0 0 12px var(--vxp-glow);
}
.settings-content { scrollbar-gutter: auto; }
.settings-panel { padding-top: 26px; }
.settings-panel.active,
.settings-function.active { animation: settings-fade-in .24s ease both; }
@keyframes settings-fade-in { from { opacity: 0; } to { opacity: 1; } }
.panel-heading { margin-bottom: 22px; }
.function-index {
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.function-index button {
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  transform: none !important;
  transition: background-color .28s ease, border-color .28s ease,
    color .28s ease, box-shadow .28s ease;
}
.function-index button:hover,
.function-index button.active {
  border-color: var(--vxp-highlight);
  background: var(--surface-3);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(255,255,255,.07), 0 0 10px var(--vxp-glow);
}
.function-index .button-sticker { width: 16px; height: 16px; flex-basis: 16px; }
.settings-function.active,
.language-settings-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-sizing: border-box;
}
.settings-function.active:hover { background: var(--surface); box-shadow: none; }
.settings-function :is(input, select),
.settings-panel .settings-form :is(input, select) {
  min-height: 42px;
  border-radius: 8px;
  background: var(--surface-2);
  transform: none !important;
}
.settings-function :is(input, select):hover,
.settings-function :is(input, select):focus {
  border-color: var(--vxp-highlight);
  box-shadow: 0 0 0 1px var(--vxp-glow);
}
.security-block,
.embedded-settings-section,
.settings-panel .settings-subheading {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  padding: 14px;
}
.settings-panel .settings-subheading { margin: 0; }
.security-block:hover,
.embedded-settings-section:hover { background: var(--surface-2); box-shadow: none; }
.settings-panel button:not(.settings-nav-button):hover { transform: none !important; }
.profile-avatar-editor .outline-button,
.language-select-button { display: inline-flex; align-items: center; gap: 9px; }
.profile-avatar-editor .outline-button > .lucide,
.language-select-button > .lucide { width: 17px; height: 17px; flex: 0 0 17px; padding: 0; border: 0; background: none; }
@media (max-width: 760px) {
  .settings-panel { width: calc(100% - 24px); padding-top: 16px; }
  .settings-nav-button { min-width: 0; justify-content: flex-start; }
  .settings-function.active, .language-settings-panel { padding: 14px; }
}

/* A focused field uses the same single highlight as hover, without a second outline. */
:is(input, textarea, select):focus-visible { outline: none !important; outline-offset: 0; }
:is(.auth-form, .settings-form, .logout-options, .compose-window,
  .modal, .account-dialog, .language-dialog, .mail-app)
  :is(input:not(:where([type="checkbox"], [type="radio"], [type="file"],
    [type="hidden"], [type="color"], [type="range"])), textarea, select):is(:focus, :focus-visible, :active),
.settings-function :is(input, select):is(:focus, :focus-visible, :active) {
  transform: none;
  border-color: var(--vxp-highlight);
  box-shadow: var(--vxp-neon);
}
:is(.mail-search, .language-search, .address-input, .compose-recipient-field):focus-within {
  transform: none;
  border-color: var(--vxp-highlight);
  box-shadow: var(--vxp-neon);
}

.profile-avatar-editor .outline-button {
  cursor: pointer;
  transform: none;
  transition: color .28s ease, background-color .28s ease,
    border-color .28s ease, box-shadow .34s var(--vxp-motion);
}
.profile-avatar-editor .outline-button:is(:hover, :focus-within) {
  transform: none;
  border-color: var(--vxp-highlight);
  background: var(--surface-3);
  box-shadow: var(--vxp-neon);
}
.profile-avatar-editor .outline-button:active {
  transform: none;
  box-shadow: 0 0 0 1px var(--vxp-highlight), 0 0 10px var(--vxp-glow);
}

.two-factor-login-dialog { scrollbar-gutter: auto; }
.two-factor-login-dialog .modal-header { padding: 19px 22px; }
.two-factor-login-dialog .auth-form { gap: 16px; padding: 22px; }
.two-factor-login-dialog .form-note { color: var(--muted); line-height: 1.5; }
.two-factor-login-dialog .form-note strong { color: var(--text); overflow-wrap: anywhere; }
.two-factor-login-dialog .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 2px;
  transform: none;
}
.two-factor-login-dialog .primary-button:hover,
.two-factor-login-dialog .primary-button:active { transform: none; }
.two-factor-login-dialog .primary-button .lucide { width: 17px; height: 17px; }

/* Settings cards present information; only their controls react to hover. */
.settings-panel :is(.settings-function, .security-block, .embedded-settings-section,
  .settings-subheading, .device-item):hover {
  transform: none;
  border-color: var(--line);
  background: var(--surface-2);
  box-shadow: none;
}
.settings-panel .settings-function:hover { background: var(--surface); }
.settings-panel .security-block, .settings-panel .device-item {
  transition: none;
  animation: none;
}

#password-section {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 15px;
}
#password-section > .lucide { width: 21px; height: 21px; color: var(--vxp-highlight); }
#password-section > div { display: grid; gap: 5px; }
#password-section h4 { font-size: 16px; }
.security-form .form-submit {
  min-width: 210px;
  justify-content: center;
  border-color: var(--vxp-highlight);
  background: var(--surface-3);
}
.security-form .form-submit:hover { box-shadow: var(--vxp-neon); }

.devices-toolbar { justify-content: flex-end; margin: 14px 0; }
.devices-toolbar .outline-button { min-width: 205px; justify-content: center; }
.device-item { align-items: start; padding: 17px; }
.device-item > div { gap: 7px; }
.device-item .device-software { color: var(--muted); }
.device-meta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-top: 5px;
}
.device-meta-row {
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.device-meta-row b { color: var(--muted); font-size: 11px; text-transform: none; }
.device-meta-row span {
  display: block;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow-wrap: anywhere;
}
.device-item > .outline-button { min-width: 100px; justify-content: center; }
.device-logout-content { display: grid; gap: 18px; padding: 22px; }
.device-logout-content p { margin: 0; color: var(--muted); line-height: 1.5; }
.device-logout-content .outline-button { display: inline-flex; align-items: center; width: 100%; justify-content: center; gap: 9px; }
@media (max-width: 600px) {
  .device-meta-row { grid-template-columns: 1fr; gap: 3px; }
  .devices-toolbar .outline-button { width: 100%; }
}

.avatar-picker {
  display: grid;
  gap: 11px;
  background: var(--surface-2);
  border-color: var(--line);
}
.avatar-picker > span:first-child { color: var(--muted); font-size: 12px; font-weight: 700; }
.avatar-picker .avatar-preview {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--line);
}
.avatar-picker-row .outline-button {
  gap: 9px;
  padding: 8px 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
  transform: none;
  transition: color .28s ease, background-color .28s ease,
    border-color .28s ease, box-shadow .34s var(--vxp-motion);
}
.avatar-picker-row .outline-button:is(:hover, :focus-within) {
  background: var(--surface-3);
  border-color: var(--vxp-highlight);
  box-shadow: var(--vxp-neon);
}
.avatar-picker-row .outline-button .lucide { width: 17px; height: 17px; }

:is(#avatar-initial, #popover-avatar, #settings-avatar, .account-list-row .small-avatar) {
  box-shadow: 0 0 0 1px var(--avatar-frame-color, #d4d4d4);
}
.avatar-border-control { display: grid; gap: 10px; padding: 3px 0 16px; }
.avatar-border-control > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.avatar-border-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.avatar-border-options > button,
.avatar-border-custom {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
  box-shadow: none;
  transform: none !important;
}
.avatar-border-options > button[data-avatar-border="none"] {
  width: 52px;
  color: var(--muted);
  font-size: 11px;
}
.avatar-border-options > button:not([data-avatar-border="none"])::before {
  width: 19px;
  height: 19px;
  border: 2px solid var(--avatar-swatch);
  border-radius: 50%;
  content: "";
}
.avatar-border-options > button[data-avatar-border="#ffffff"] { --avatar-swatch: #ffffff; }
.avatar-border-options > button[data-avatar-border="#d4d4d4"] { --avatar-swatch: #d4d4d4; }
.avatar-border-options > button[data-avatar-border="#111111"] { --avatar-swatch: #111111; }
.avatar-border-options > button[data-avatar-border="#e25555"] { --avatar-swatch: #e25555; }
.avatar-border-options > button[data-avatar-border="#e59a42"] { --avatar-swatch: #e59a42; }
.avatar-border-options > button[data-avatar-border="#e3c75c"] { --avatar-swatch: #e3c75c; }
.avatar-border-options > button[data-avatar-border="#4caf83"] { --avatar-swatch: #4caf83; }
.avatar-border-options > button[data-avatar-border="#5b9be0"] { --avatar-swatch: #5b9be0; }
.avatar-border-options > button[data-avatar-border="#a575d9"] { --avatar-swatch: #a575d9; }
.avatar-border-options > :is(button, label):is(:hover, .active, :focus-within) {
  border-color: var(--vxp-highlight);
  background: var(--surface-3);
  box-shadow: var(--vxp-neon);
}
.avatar-border-custom { position: relative; overflow: hidden; }
.avatar-border-custom .lucide { width: 18px; height: 18px; color: var(--muted); }
.avatar-border-custom input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.settings-sound-field { display: grid; gap: 8px; }
.settings-sound-field > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.settings-sound-field > select[hidden] { display: none !important; }
.sound-picker { position: relative; }
.sound-picker > button {
  display: flex;
  width: 100%;
  min-height: 44px;
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
}
.sound-picker > button span { flex: 1; }
.sound-picker > button .lucide { width: 17px; height: 17px; }
.sound-picker-options {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}
.sound-picker-options[hidden] { display: none !important; }
.sound-picker-options button {
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
  transform: none !important;
}
.sound-picker-options button:is(:hover, .active) {
  border-color: var(--vxp-highlight);
  background: var(--surface-3);
}

.sound-volume-control input[type="range"] {
  width: 100%;
  height: 7px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent) var(--range-fill, 0%), var(--surface-3) var(--range-fill, 0%));
  box-shadow: none !important;
  cursor: pointer;
  transform: none !important;
}
.sound-volume-control input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  appearance: none;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
  transition: box-shadow .2s ease;
}
.sound-volume-control input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  transition: box-shadow .2s ease;
}
.settings-form .sound-toggle { cursor: default; }
.settings-form .sound-toggle:is(:hover, :focus-within) {
  border-color: var(--line);
  background: var(--surface-2);
  box-shadow: none;
  transform: none;
}
.settings-form .sound-toggle input {
  width: 46px;
  height: 26px;
  background: var(--line);
  box-shadow: none !important;
  transform: none !important;
  transition: background-color .25s ease, box-shadow .25s ease;
}
.settings-form .sound-toggle input::after {
  width: 20px;
  height: 20px;
  background: #fff;
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.settings-form .sound-toggle input:checked { background: var(--accent); }
.settings-form .sound-toggle input:checked::after { transform: translateX(20px); }
.settings-form .sound-toggle input:is(:hover, :focus-visible) { box-shadow: 0 0 0 3px var(--accent-soft) !important; }

.logout-all-accounts { display: inline-flex; align-items: center; width: 100%; justify-content: center; gap: 8px; margin-top: 12px; }
.logout-confirmation { display: grid; gap: 18px; padding: 22px; }

/* The chosen frame belongs to the avatar, not its accent-colored fallback. */
:is(.large-avatar, .small-avatar, .avatar-button):has(> img) {
  background: transparent;
}
#settings-avatar, #popover-avatar, #avatar-initial, .account-list-row .small-avatar {
  outline: 0;
  border-color: transparent;
  box-shadow: 0 0 0 1px var(--avatar-frame-color, #d4d4d4);
}
.avatar-border-options > :is(button, label).active {
  border-color: var(--line);
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--text);
}

/* Device identity and location are independent rows; the current badge sits by the name. */
#devices-section {
  padding: 0;
  border: 0;
  background: transparent;
}
.settings-panel #devices-section > .settings-subheading,
.settings-panel #devices-section > .settings-subheading:hover {
  display: grid;
  gap: 4px;
  padding: 0 0 15px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.device-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 11px; }
.device-heading strong { font-size: 14px; }
.device-heading em {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--success) 40%, var(--line));
  border-radius: 999px;
  color: var(--success);
  font-size: 11px;
  white-space: nowrap;
}
.device-detail-list { display: grid; gap: 6px; }
.device-item .device-detail-list > span {
  display: block;
  min-height: 31px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* One styled picker for every settings select. */
.settings-sound-field > select[hidden],
.settings-form select[hidden] { display: none !important; }
.sound-picker > button { align-items: center; }
.sound-picker-options { max-height: min(260px, 45dvh); overflow-y: auto; overscroll-behavior: contain; }
.sound-picker-options.drop-up { top: auto; bottom: calc(100% + 6px); }
.sound-picker-options button { width: 100%; }

/* Quiet hover, immediate strong focus; wrappers draw only one ring. */
:is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="color"]):not([type="range"]), textarea, select):hover:not(:focus),
:is(.mail-search, .language-search, .address-input, .compose-recipient-field, .compose-window .compose-field):hover:not(:focus-within),
.settings-function :is(input, select):hover:not(:focus) {
  border-color: var(--vxp-highlight);
  box-shadow: none;
  transform: none;
}
:is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="color"]):not([type="range"]), textarea, select):focus,
:is(.mail-search, .language-search, .address-input, .compose-recipient-field, .compose-window .compose-field):focus-within,
.settings-function :is(input, select):focus {
  outline: none;
  border-color: var(--vxp-highlight);
  box-shadow: var(--vxp-neon-focus);
  transform: none;
}
:is(.mail-search, .language-search, .address-input, .compose-recipient-field, .compose-window .compose-field) :is(input, textarea):is(:hover, :focus) {
  border-color: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}
:is(.mail-search, .language-search, .address-input, .compose-recipient-field, .compose-window .compose-field) :is(input, textarea) {
  box-shadow: none !important;
}
:is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="color"]):not([type="range"]), textarea, select,
  .mail-search, .language-search, .address-input, .compose-recipient-field, .compose-window .compose-field) {
  transition: border-color .16s ease, background-color .16s ease, box-shadow .18s ease;
}

/* A narrow rounded scrollbar centered within its transparent track. */
@supports (-moz-appearance: none) {
  * { scrollbar-width: thin; scrollbar-color: #858585 transparent; }
}
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-track,
*::-webkit-scrollbar-track-piece { background: transparent; border: 0; }
*::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb:hover {
  border: 3px solid transparent;
  border-radius: 999px;
  background: #858585;
  background-clip: padding-box;
  box-shadow: none;
}
*::-webkit-scrollbar-button { display: none !important; width: 0 !important; height: 0 !important; }
*::-webkit-scrollbar-corner { background: transparent; }

.settings-savebar .outline-button,
.settings-savebar .primary-button { min-height: 40px; padding: 0 18px; }
.settings-savebar > div > button {
  display: inline-flex;
  min-width: 142px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
.settings-savebar > div > button .lucide {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}
@media (max-width: 600px) {
  .settings-savebar > div { display: grid; grid-template-columns: 1fr 1fr; }
  .settings-savebar > div > button { width: 100%; min-width: 0; padding: 0 8px; }
}

.recovery-email-dialog .modal-header p { display: none; }
.recovery-email-dialog .modal-copy {
  margin: 20px 22px 0;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.recovery-email-dialog .modal-copy strong { color: var(--text); }
.recovery-email-dialog .auth-form { gap: 18px; padding: 18px 22px 22px; }
.recovery-email-dialog .auth-form label { gap: 8px; }
.recovery-email-dialog .auth-form input { width: 100%; }
.recovery-email-dialog .primary-button { min-height: 44px; justify-content: center; }

.action-confirm-content { display: grid; gap: 20px; padding: 22px; }
.action-confirm-content p { margin: 0; color: var(--muted); line-height: 1.5; }
.action-confirm-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-confirm-buttons button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; }
.action-confirm-buttons .lucide { width: 16px; height: 16px; }
#permanent-delete-dialog .permanent-delete-content > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
#permanent-delete-dialog .permanent-delete-content > div > button { display: inline-flex; width: 100%; min-width: 0; align-items: center; justify-content: center; gap: 8px; }
#permanent-delete-dialog .permanent-delete-content > div .lucide { width: 16px; height: 16px; flex: 0 0 16px; }
.action-confirm-buttons .danger-button,
.permanent-delete-content .danger-button {
  border: 1px solid #9e4e55;
  background: rgba(226, 85, 85, .14);
  color: #ffbec3;
}
.action-confirm-buttons .danger-button:hover,
.permanent-delete-content .danger-button:hover {
  border-color: #e25555;
  background: rgba(226, 85, 85, .22);
  box-shadow: 0 0 0 1px rgba(226, 85, 85, .35), 0 0 16px rgba(226, 85, 85, .14);
}
html[data-theme="light"] :is(.action-confirm-buttons, .permanent-delete-content) .danger-button {
  color: #9c2531;
}
@media (max-width: 420px) {
  .action-confirm-buttons { grid-template-columns: 1fr; }
}

/* Message list keeps selection in the first column; actions live in the reader. */
.message-row { grid-template-columns: 38px minmax(0, 1fr); }
.message-row .message-open { padding-left: 8px; }

/* A single reader surface contains the subject and the whole conversation. */
.reader { min-width: 0; background: var(--bg); }
.reader-toolbar {
  min-height: 72px;
  padding: 10px 20px;
  gap: 12px;
  background: var(--surface);
}
.reader-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.reader-actions .reader-action-button {
  display: inline-flex;
  width: 138px;
  min-width: 138px;
  flex: 0 0 138px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  color: var(--text);
  white-space: nowrap;
}
.reader-actions .reader-action-button[hidden] { display: none; }
.reader-actions .reader-action-button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.reader-actions .reader-action-button:is(:hover, :active, :focus-visible) { transform: none !important; }
.reader-actions .reader-action-button .lucide { width: 16px; height: 16px; }
.reader-actions .reader-action-button.active {
  border-color: var(--vxp-highlight);
  background: var(--surface-3);
  box-shadow: 0 0 0 1px var(--vxp-glow);
}
.reader-actions .reader-action-button.active .lucide { fill: currentColor; }
.reader-toolbar #reader-back { width: 94px; min-width: 94px; justify-content: center; }
.bulk-actions > #selected-message-count { width: 116px; min-width: 116px; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1251px) {
  .bulk-actions > .bulk-action-button { width: 132px; min-width: 132px; flex: 0 0 132px; justify-content: center; white-space: nowrap; }
  .refresh-action-button { width: 118px; min-width: 118px; justify-content: center; }
}
@media (max-width: 1250px) {
  .bulk-actions > .bulk-action-button, .refresh-action-button { width: 36px; min-width: 36px; flex: 0 0 36px; justify-content: center; padding: 0; }
  .bulk-actions > .bulk-action-button span, .refresh-action-button span, .bulk-actions > #selected-message-count { display: none; }
}
.reader-content {
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: clamp(16px, 3vw, 36px);
  background: var(--bg);
  overflow-y: auto;
}
.reader-surface {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 16px 46px rgba(0, 0, 0, .15);
}
.reader:not([hidden]) .reader-surface {
  animation: reader-surface-enter .32s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes reader-surface-enter {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
.reader-overview {
  display: grid;
  gap: 7px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.reader-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.reader-content .reader-overview h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(21px, 2.1vw, 27px);
  line-height: 1.3;
}
.reader-overview p { margin: 0; color: var(--muted); font-size: 12px; }
.reader .conversation-thread {
  gap: 18px;
  margin-top: 22px;
  background: transparent;
}
.reader .thread-message {
  width: min(790px, 100%);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  box-shadow: none;
}
.reader .thread-message.incoming { justify-self: start; border-left: 3px solid var(--muted); }
.reader .thread-message.outgoing {
  justify-self: end;
  border-color: var(--line);
  border-left: 3px solid var(--vxp-highlight);
  background: color-mix(in srgb, var(--surface-3) 45%, var(--surface-2));
}
.reader .thread-message:is(.selected, :hover) { border-color: var(--line); box-shadow: none; transform: none; }
.reader .thread-message.incoming:is(.selected, :hover) { border-left-color: var(--muted); }
.reader .thread-message.outgoing:is(.selected, :hover) { border-left-color: var(--vxp-highlight); }
.reader .thread-message header { padding: 14px 17px; background: transparent; }
.reader .thread-message-content { padding: 17px; }
.thread-identity-heading { display: flex !important; align-items: center; gap: 8px; }
.thread-identity-heading strong { min-width: 0; }
.thread-direction {
  display: inline-flex;
  width: max-content;
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px !important;
  font-weight: 700;
  line-height: 1.2;
}
.outgoing .thread-direction { color: var(--text); border-color: var(--vxp-highlight); }
.reader .reader-reply-bar { background: transparent; }
@media (max-width: 1150px) {
  .reader-actions .reader-action-button { width: 38px; min-width: 38px; flex-basis: 38px; padding: 0; }
  .reader-actions .reader-action-button span { display: none; }
}
@media (max-width: 700px) {
  .reader-toolbar { align-items: stretch; flex-direction: column; padding: 12px 14px; }
  .reader-toolbar #reader-back { align-self: flex-start; }
  .reader-actions { justify-content: flex-start; }
  .reader-actions .reader-action-button { width: 38px; min-width: 38px; flex-basis: 38px; padding: 0; }
  .reader-actions .reader-action-button span { display: none; }
  .reader-content { padding: 14px; }
  .reader-surface { padding: 17px; }
  .reader .thread-message { width: 100%; }
  .reader .thread-message header { grid-template-columns: 32px minmax(0, 1fr); }
  .reader .thread-message header time { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .reader:not([hidden]) .reader-surface { animation: none; }
}
.logout-confirmation p { margin: 0; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.logout-confirmation button { display: inline-flex; align-items: center; width: 100%; justify-content: center; gap: 9px; }

.segmented-control label { position: relative; }
.segmented-control input {
  top: 50%;
  left: 50%;
  width: 1px !important;
  height: 1px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none !important;
  transform: none !important;
}

