:root {
  --brand: #cc0000;
  --red: var(--brand);
  --red-bright: color-mix(in srgb, var(--brand) 82%, white);
  --red-dark: color-mix(in srgb, var(--brand) 82%, black);
  --brand-soft: color-mix(in srgb, var(--brand) 12%, transparent);
  --brand-faint: color-mix(in srgb, var(--brand) 8%, transparent);
  --dark: #192126;
  --bg: #f4f5f6;
  --paper: #ffffff;
  --border: #e2e4e6;
  --text: rgba(0, 0, 0, 0.72);
  --text-muted: rgba(0, 0, 0, 0.55);
  --on-dark: #ffffff;
  --preview: rgba(0, 0, 0, 0.45);
  --row-hover: #f0f1f2;
  --unread-bg: #fff;
  --radius-btn: 4px;
  --radius-card: 16px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --shadow: 0 8px 28px rgba(25, 33, 38, 0.06);
  --side-w: 220px;
  --icon-muted: #c4c7c5;
  --icon-hover: #5f6368;
  --star-gold: #f4b400;
}
html.theme-dark {
  --bg: #12181c;
  --paper: #1a2228;
  --border: #2a333a;
  --text: rgba(255, 255, 255, 0.86);
  --text-muted: rgba(255, 255, 255, 0.55);
  --preview: rgba(255, 255, 255, 0.4);
  --row-hover: #222b32;
  --unread-bg: #1e272e;
  --dark: #e8ecef;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --icon-muted: #6b7280;
  --icon-hover: #d1d5db;
  --star-gold: #f4b400;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--red);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-btn);
  background: var(--red);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}
.brand-logo {
  display: block;
  height: 32px;
  max-width: 160px;
  width: auto;
  object-fit: contain;
}
.brand.has-domain-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
}
.brand.has-domain-logo .brand-mark,
.brand.has-domain-logo .brand-text {
  display: none;
}
.brand.has-domain-logo .brand-logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 200px;
  margin: 0 auto;
  object-fit: contain;
}
.brand-logo.hidden { display: none !important; }
.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  font-size: 1.25rem;
  line-height: 1;
  user-select: none;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--red);
  border-radius: var(--radius-btn);
  background: var(--red);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--red-bright); border-color: var(--red-bright); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-bright); border-color: var(--red-bright); color: #fff; }
.btn-secondary {
  background: var(--paper);
  border-color: var(--border);
  color: var(--dark);
}
.btn-secondary:hover {
  background: #e8eaed;
  border-color: #dadce0;
  color: var(--dark);
}
html.theme-dark .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: #e8ecef;
}
.btn-danger {
  background: transparent;
  border-color: transparent;
  color: var(--red);
}
.btn-danger:hover {
  background: color-mix(in srgb, var(--red) 12%, transparent);
  border-color: transparent;
  color: var(--red);
}
.btn-danger-solid {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn-danger-solid:hover {
  background: var(--red-bright);
  border-color: var(--red-bright);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { background: var(--row-hover); color: var(--dark); }
.btn-icon { min-width: 2.25rem; width: 2.25rem; height: 2.25rem; padding: 0.4rem; }
.btn-compact { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-compose {
  width: 100%;
  margin-bottom: 0.75rem;
  border-radius: 1.25rem;
  padding: 0.85rem 1.25rem;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  gap: 0;
}
/* Default: icon hidden (desktop sidebar shows text only). FAB re-enables it. */
.btn-compose:not(.btn-compose-fab) .btn-compose-icon { display: none; }

.login-body {
  min-height: 100dvh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.25rem;
  box-sizing: border-box;
  background: var(--bg);
}
.login-shell {
  width: min(920px, 100%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.login-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1.5rem 2.5rem;
  align-items: stretch;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 2.5rem 2.25rem;
  box-sizing: border-box;
}
.login-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1rem;
  padding: 0.25rem 0 0;
  text-align: left;
  min-width: 0;
}
.login-hero-brand {
  margin: 0;
  text-decoration: none;
}
.login-hero-brand.brand {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.85rem;
  font-size: 2.25rem;
}
.login-hero .brand-mark {
  width: 96px;
  height: 96px;
  font-size: 1.75rem;
  border-radius: 14px;
}
.login-hero .brand.has-domain-logo {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: auto;
  max-width: 100%;
}
.login-hero .brand.has-domain-logo .brand-logo {
  display: block;
  width: auto;
  max-width: 360px;
  height: auto;
  max-height: 180px;
  margin: 0;
  object-fit: contain;
}
.login-sub {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.4;
}
.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 0;
}
.login-panel form {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 220px;
}
.login-pass-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.login-pass-wrap input {
  padding-right: 2.75rem;
}
.login-pass-toggle {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  background: transparent;
  border: none;
  box-shadow: none;
}
.login-pass-toggle:hover {
  color: var(--dark);
  background: var(--brand-faint);
}
.login-pass-toggle .material-symbols-outlined {
  font-size: 1.25rem;
}
.login-panel .turnstile-wrap {
  margin: 0 0 1rem;
  min-height: 65px;
}
.login-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 1.25rem;
}
.login-submit {
  min-width: 7rem;
  border-radius: 999px;
  padding: 0.7rem 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}
.login-submit.sending,
.login-submit:disabled {
  cursor: wait;
  opacity: 0.92;
}
.login-submit-spinner {
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: compose-send-spin 0.65s linear infinite;
  flex-shrink: 0;
}
.login-footer {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.35rem;
}
.login-lang-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.login-lang {
  appearance: none;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--dark);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 2rem 0.45rem 0.7rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(50% - 2px), calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
  min-width: 11rem;
}
.login-lang:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--brand-soft);
  border-color: var(--brand);
}
@media (max-width: 799px) {
  .login-body {
    align-items: flex-start;
    padding: 1.25rem 1rem 2rem;
  }
  .login-card {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    border-radius: 24px;
    padding: 1.75rem 1.35rem 1.5rem;
  }
  .login-hero {
    align-items: flex-start;
    justify-content: flex-start;
  }
  .login-hero-brand.brand {
    font-size: 1.35rem;
  }
  .login-hero .brand-mark {
    width: 48px;
    height: 48px;
    font-size: 1rem;
  }
  .login-hero .brand.has-domain-logo .brand-logo {
    max-width: 180px;
    max-height: 64px;
  }
  .login-panel form {
    min-height: 0;
  }
  .login-actions {
    margin-top: 0.5rem;
  }
}
.field { margin: 0 0 0.9rem; }
.field label {
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
input, textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font: inherit;
  color: var(--dark);
  background: var(--paper);
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--red);
}
#signature { resize: none; }
.sig-editor-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--paper);
  overflow: hidden;
}
.sig-toolbar {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.25rem 0.35rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--paper) 92%, var(--dark));
}
.sig-toolbar .btn-icon {
  width: 2rem;
  height: 2rem;
}
.sig-toolbar .material-symbols-outlined { font-size: 1.15rem; }
.sig-font-size {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: 0.25rem;
  color: var(--text-muted);
}
.sig-font-size .material-symbols-outlined { font-size: 1.05rem; }
.sig-font-size select {
  width: auto;
  min-width: 5.5rem;
  padding: 0.25rem 0.4rem;
  font-size: 0.8rem;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--dark);
  cursor: pointer;
}
.sig-font-size select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 2px var(--brand-soft);
}
.sig-editor {
  min-height: 7.5rem;
  max-height: 14rem;
  overflow-y: auto;
  padding: 0.65rem 0.8rem;
  font: inherit;
  color: var(--dark);
  outline: none;
  line-height: 1.45;
  word-break: break-word;
}
.sig-editor:focus {
  box-shadow: inset 0 0 0 2px var(--brand-soft);
}
.sig-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}
.sig-auto-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 0.85rem;
  font-size: 0.9rem;
  color: var(--dark);
  cursor: pointer;
  line-height: 1.35;
}
.sig-auto-check input {
  width: auto;
  margin-top: 0.15rem;
  accent-color: var(--red);
  flex-shrink: 0;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}
.compose-sig-preview {
  margin-top: 0.75rem;
  margin-bottom: 0.35rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid #dadce0;
  border-left: 3px solid var(--red);
  border-radius: 8px;
  background: #f8f9fa;
  flex-shrink: 0;
  user-select: text;
  cursor: default;
}
.compose-locked-block {
  position: relative;
}
.compose-locked-badge {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #5f6368;
  margin-bottom: 0.45rem;
}
.compose-locked-badge .material-symbols-outlined {
  font-size: 0.95rem;
  color: var(--red);
}
.compose-locked-hint {
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  font-size: 0.72rem;
  color: #80868b;
  background: #e8eaed;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}
.compose-sig-preview-html {
  font-size: 0.92rem;
  line-height: 1.45;
  color: #202124;
  word-break: break-word;
}
.compose-sig-preview-html a { color: var(--red); }
.compose-quote-preview {
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid #dadce0;
  border-left: 3px solid #9aa0a6;
  border-radius: 8px;
  background: #f8f9fa;
  flex-shrink: 0;
  user-select: text;
  cursor: default;
}
.compose-quote-header {
  font-size: 0.8rem;
  color: #5f6368;
  margin-bottom: 0.45rem;
  line-height: 1.35;
}
.compose-quote-body {
  margin: 0;
  padding: 0.35rem 0 0.15rem 0.75rem;
  border-left: 3px solid #dadce0;
  color: #202124;
  font-size: 0.88rem;
  line-height: 1.45;
  max-height: none;
  overflow: visible;
  word-break: break-word;
}
.compose-quote-body img { max-width: 100%; height: auto; }

/* Gmail-like compose window */
.compose-backdrop.dialog-backdrop {
  background: transparent;
  place-items: end;
  justify-content: end;
  align-items: end;
  padding: 0 1rem 1rem 0;
  pointer-events: none;
  z-index: 55;
}
.compose-backdrop.open {
  display: grid;
}
.compose-window {
  pointer-events: auto;
  width: min(580px, calc(100vw - 1.5rem));
  height: min(560px, calc(100dvh - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 8px 28px rgba(32, 33, 36, 0.28), 0 1px 3px rgba(32, 33, 36, 0.12);
  overflow: hidden;
  color: #202124;
  font-family: var(--font-body);
  transition: width 0.2s var(--ease-out), height 0.2s var(--ease-out);
}
.compose-window.expanded {
  width: min(920px, calc(100vw - 1.5rem));
  height: min(85dvh, calc(100dvh - 1.5rem));
}
.compose-window.minimized {
  height: 3rem;
  width: min(320px, calc(100vw - 1.5rem));
}
.compose-window.minimized .compose-fields,
.compose-window.minimized .compose-body-area,
.compose-window.minimized .compose-attach-bar,
.compose-window.minimized .compose-format-bar,
.compose-window.minimized .compose-foot {
  display: none !important;
}
.compose-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem 0.55rem 1rem;
  background: #f2f6fc;
  color: #001d35;
  flex-shrink: 0;
  cursor: default;
  user-select: none;
}
.compose-head h2 {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0;
  color: #001d35;
}
.compose-head-actions {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}
.compose-icon-btn {
  border: 0;
  background: transparent;
  color: inherit;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.compose-icon-btn .material-symbols-outlined {
  font-size: 1.2rem;
}
.compose-head .compose-icon-btn {
  color: #444746;
}
.compose-head .compose-icon-btn:hover {
  background: rgba(68, 71, 70, 0.08);
}
.compose-fields {
  flex-shrink: 0;
  background: #fff;
}
.compose-from-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.65rem 1rem 0.45rem;
  font-size: 0.875rem;
  color: #202124;
  border-bottom: 1px solid #e8eaed;
}
.compose-from-label {
  color: #5f6368;
  font-weight: 400;
}
.compose-from-value {
  color: #202124;
  font-weight: 500;
}
.compose-field-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.15rem 1rem;
  min-height: 2.4rem;
  border-bottom: 1px solid #e8eaed;
}
.compose-field-label {
  flex-shrink: 0;
  min-width: 1.75rem;
  margin: 0;
  padding-top: 0.7rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: #5f6368;
}
.compose-field-input {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  background: transparent;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  color: #202124;
  font-family: inherit;
  border-radius: 0;
}
.compose-chip-field {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0;
  cursor: text;
}
.compose-chips {
  display: contents;
}
.compose-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  max-width: 100%;
  padding: 0.15rem 0.2rem 0.15rem 0.55rem;
  border-radius: 999px;
  background: #e8f0fe;
  color: #174ea6;
  font-size: 0.8rem;
  line-height: 1.25;
  cursor: default;
  user-select: none;
}
.compose-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 16rem;
}
.compose-chip-remove {
  border: 0;
  background: transparent;
  color: #174ea6;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.75;
}
.compose-chip-remove:hover {
  background: rgba(23, 78, 166, 0.12);
  opacity: 1;
}
.compose-chip.invalid {
  background: #fce8e6;
  color: #c5221f;
}
.compose-chip.invalid .compose-chip-remove {
  color: #c5221f;
}
.compose-chip.invalid .compose-chip-remove:hover {
  background: rgba(197, 34, 31, 0.12);
}
.compose-chip-input {
  flex: 1 1 8rem;
  min-width: 6rem;
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  background: transparent;
  padding: 0.35rem 0;
  font-size: 0.9rem;
  color: #202124;
  font-family: inherit;
}
.compose-subject-row {
  align-items: center;
}
.compose-subject-row .compose-field-input {
  padding: 0.5rem 0;
}
.compose-cc-toggles {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding-top: 0.55rem;
}
.compose-subject-input {
  padding-left: 0;
}
.compose-subject-input::placeholder {
  color: #80868b;
}
.compose-text-toggle {
  border: 0;
  background: transparent;
  color: #5f6368;
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0.15rem 0;
}
.compose-text-toggle:hover {
  color: #202124;
  text-decoration: underline;
}
.compose-body-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.65rem 1rem 0.35rem;
  overflow: auto;
  background: #fff;
  overscroll-behavior: contain;
}
.compose-body-input {
  flex: 0 0 auto;
  min-height: 8rem;
  width: 100%;
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  resize: none;
  padding: 0.25rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
  font-family: Arial, Helvetica, sans-serif;
  color: #202124;
  background: transparent;
}
.compose-editor {
  overflow: visible;
  word-break: break-word;
}
.compose-sig-preview,
.compose-quote-preview {
  flex: 0 0 auto;
}
.compose-editor:empty:before {
  content: attr(data-placeholder);
  color: #80868b;
  pointer-events: none;
}
.compose-editor:focus {
  outline: none;
}
.compose-format-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
  margin: 0 0.85rem 0.55rem;
  padding: 0.3rem 0.45rem;
  background: #edf2fa;
  border-radius: 1.25rem;
  flex-shrink: 0;
}
.compose-format-bar[hidden] {
  display: none !important;
}
.compose-fmt-dropdown {
  position: relative;
  flex-shrink: 0;
}
.compose-fmt-trigger {
  border: 0;
  background: transparent;
  color: #3c4043;
  font-size: 0.8rem;
  font-family: inherit;
  height: 2rem;
  border-radius: 1rem;
  padding: 0 0.2rem 0 0.55rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.05rem;
  max-width: 8.5rem;
}
.compose-fmt-dropdown-size .compose-fmt-trigger {
  max-width: 6.25rem;
}
.compose-fmt-trigger:hover,
.compose-fmt-trigger[aria-expanded="true"] {
  background: rgba(60, 64, 67, 0.08);
}
.compose-fmt-trigger-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 6.5rem;
}
.compose-fmt-dropdown-size .compose-fmt-trigger-label {
  max-width: 4.25rem;
}
.compose-fmt-trigger .material-symbols-outlined {
  font-size: 1.2rem;
  color: #5f6368;
  flex-shrink: 0;
}
.compose-fmt-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.35rem);
  z-index: 12;
  min-width: 11rem;
  max-height: min(18rem, 50vh);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.35rem 0;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(32, 33, 36, 0.18);
}
.compose-fmt-menu-size {
  min-width: 8.5rem;
}
.compose-fmt-menu.hidden {
  display: none !important;
}
.compose-fmt-option {
  display: flex;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.45rem 0.85rem;
  color: #202124;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.25;
  white-space: nowrap;
}
.compose-fmt-option:hover,
.compose-fmt-option.active {
  background: #f1f3f4;
}
.compose-fmt-option.active {
  color: var(--red);
  font-weight: 600;
}
.compose-fmt-menu-font .compose-fmt-option {
  font-size: 0.95rem;
}
.compose-fmt-menu-size .compose-fmt-option {
  min-height: 2.1rem;
}
.compose-fmt-dropdown-color .compose-fmt-menu {
  min-width: 0;
  padding: 0.45rem;
  bottom: calc(100% + 0.35rem);
}
.compose-fmt-color-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.compose-fmt-color-btn .material-symbols-outlined {
  font-size: 1.15rem;
  line-height: 1;
}
.compose-fmt-color-bar {
  display: block;
  width: 0.95rem;
  height: 0.22rem;
  border-radius: 1px;
  margin-top: -0.12rem;
  background: currentColor;
  flex-shrink: 0;
}
#composeForeColorBar { background: #202124; }
#composeBackColorBar { background: #fbbc04; }
.compose-fmt-color-grid {
  display: grid;
  grid-template-columns: repeat(8, 1.35rem);
  gap: 0.2rem;
}
.compose-fmt-color-swatch {
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 3px;
  padding: 0;
  cursor: pointer;
  background: #fff;
  box-sizing: border-box;
}
.compose-fmt-color-swatch:hover,
.compose-fmt-color-swatch.active {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}
.compose-fmt-color-swatch.none {
  position: relative;
  background:
    linear-gradient(to top right, transparent calc(50% - 0.6px), #c5221f 50%, transparent calc(50% + 0.6px)),
    #fff;
}
.compose-fmt-color-actions {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.4rem;
  padding-top: 0.35rem;
  border-top: 1px solid #e8eaed;
}
.compose-fmt-color-action {
  flex: 1;
  border: 0;
  background: transparent;
  color: #3c4043;
  font-size: 0.72rem;
  font-family: inherit;
  font-weight: 600;
  padding: 0.35rem 0.4rem;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
}
.compose-fmt-color-action:hover {
  background: #f1f3f4;
}
html.theme-dark .compose-fmt-color-swatch {
  border-color: rgba(255, 255, 255, 0.18);
}
html.theme-dark .compose-fmt-color-actions {
  border-top-color: #5f6368;
}
html.theme-dark .compose-fmt-color-action {
  color: #e8eaed;
}
html.theme-dark .compose-fmt-color-action:hover {
  background: #3c4043;
}
html.theme-dark .compose-fmt-trigger {
  color: #e8eaed;
}
html.theme-dark .compose-fmt-trigger:hover,
html.theme-dark .compose-fmt-trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.08);
}
html.theme-dark .compose-fmt-menu {
  background: #2d2e30;
  border-color: #5f6368;
}
html.theme-dark .compose-fmt-option {
  color: #e8eaed;
}
html.theme-dark .compose-fmt-option:hover,
html.theme-dark .compose-fmt-option.active {
  background: #3c4043;
}
.compose-fmt-btn {
  border: 0;
  background: transparent;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #3c4043;
  cursor: pointer;
  padding: 0;
}
.compose-fmt-btn:hover {
  background: rgba(60, 64, 67, 0.08);
}
.compose-fmt-btn .material-symbols-outlined {
  font-size: 1.15rem;
}
.compose-fmt-sep {
  width: 1px;
  height: 1.15rem;
  background: #dadce0;
  margin: 0 0.2rem;
}
.compose-foot {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem 0.75rem 1rem;
  flex-shrink: 0;
  background: #fff;
}
.compose-send-group {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  border-radius: 1.25rem;
  overflow: visible;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.2);
}
.compose-send-btn {
  border: 0;
  background: var(--red);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.65rem 1.15rem;
  border-radius: 1.25rem 0 0 1.25rem;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.35rem;
  min-width: 5.5rem;
  transition: opacity 0.15s var(--ease-out);
}
.compose-send-btn:hover:not(:disabled) {
  background: var(--red-bright);
}
.compose-send-btn:disabled,
.compose-send-btn.sending {
  cursor: wait;
  opacity: 0.92;
}
.compose-send-spinner {
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: compose-send-spin 0.65s linear infinite;
  flex-shrink: 0;
}
@keyframes compose-send-spin {
  to { transform: rotate(360deg); }
}
.compose-send-group.sending .compose-send-caret {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}
.compose-send-caret {
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
  background: var(--red);
  color: #fff;
  width: 2rem;
  border-radius: 0 1.25rem 1.25rem 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.compose-send-caret:hover {
  background: var(--red-bright);
}
.compose-send-caret .material-symbols-outlined {
  font-size: 1.35rem;
}
.compose-send-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.35rem);
  min-width: 10rem;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(32, 33, 36, 0.2);
  padding: 0.35rem;
  z-index: 5;
}
.compose-send-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #202124;
  cursor: pointer;
  font-family: inherit;
}
.compose-send-menu button:hover {
  background: #f1f3f4;
}
.compose-tool-row {
  display: flex;
  align-items: center;
  gap: 0.05rem;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  color: #5f6368;
  position: relative;
}
.compose-attach-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem 0.35rem;
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid #f1f3f4;
  max-height: 5.5rem;
  overflow-y: auto;
}
.compose-attach-bar.hidden { display: none; }
.compose-attach-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background: #f8f9fa;
  font-size: 0.82rem;
  color: #3c4043;
  max-width: min(14rem, 100%);
}
.compose-attach-item .material-symbols-outlined {
  font-size: 1rem;
  color: #5f6368;
}
.compose-attach-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compose-attach-size {
  font-size: 0.75rem;
  color: #80868b;
  flex-shrink: 0;
}
.compose-attach-remove {
  border: 0;
  background: transparent;
  color: #80868b;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
  border-radius: 4px;
}
.compose-attach-remove:hover {
  color: var(--red);
  background: var(--brand-faint);
}

.compose-sub-backdrop {
  position: fixed;
  inset: 0;
  z-index: 58;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(32, 33, 36, 0.35);
}
.compose-sub-backdrop.hidden { display: none !important; }
.compose-float-layer {
  position: fixed;
  inset: 0;
  z-index: 58;
  background: transparent;
}
.compose-float-layer.hidden { display: none !important; }
.compose-sub-panel {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(32, 33, 36, 0.28), 0 1px 3px rgba(32, 33, 36, 0.12);
  width: min(400px, calc(100vw - 2rem));
  overflow: hidden;
  color: #202124;
  font-family: var(--font-body);
}
.compose-sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem 0.55rem 1rem;
  background: #f2f6fc;
  color: #001d35;
}
.compose-sub-head h2 {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: #001d35;
}
.compose-sub-head .compose-icon-btn {
  color: #444746;
}
.compose-sub-head .compose-icon-btn:hover {
  background: rgba(68, 71, 70, 0.08);
}
.compose-sub-body {
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: #fff;
}
.compose-sub-field {
  border-bottom: 1px solid #f1f3f4;
  padding: 0.35rem 0;
}
.compose-sub-field:last-child {
  border-bottom: 0;
}
.compose-sub-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem 1rem 0.85rem;
  background: #fff;
}
.compose-sub-cancel {
  border: 0;
  background: transparent;
  color: #5f6368;
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0.45rem 0.75rem;
  border-radius: 4px;
  flex-shrink: 0;
}
.compose-sub-cancel:hover {
  background: #f1f3f4;
  color: #202124;
}
.compose-sub-foot .compose-send-btn {
  border-radius: 1.25rem;
  min-width: auto;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0.55rem 1.1rem;
}
.compose-emoji-panel {
  position: fixed;
  width: fit-content;
  max-width: calc(100vw - 1rem);
  top: 0;
  left: 0;
}
.compose-emoji-panel .compose-sub-head {
  padding-left: 0.85rem;
  padding-right: 0.85rem;
}
.compose-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 2.35rem);
  gap: 0.25rem;
  padding: 0.75rem 0.85rem;
  overflow: visible;
  background: #fff;
  box-sizing: border-box;
}
.compose-emoji-btn {
  border: 0;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
}
.compose-emoji-btn:hover {
  background: #f1f3f4;
}
html.theme-dark .compose-attach-bar {
  background: #2d2e30;
  border-top-color: #3c4043;
}
html.theme-dark .compose-attach-item {
  background: #3c4043;
  border-color: #5f6368;
  color: #e8eaed;
}
html.theme-dark .compose-sub-panel,
html.theme-dark .compose-sub-body,
html.theme-dark .compose-sub-foot,
html.theme-dark .compose-emoji-grid {
  background: #2d2e30;
  border-color: #5f6368;
  color: #e8eaed;
}
html.theme-dark .compose-sub-head {
  background: #394457;
  color: #e8eaed;
}
html.theme-dark .compose-sub-head h2 {
  color: #e8eaed;
}
html.theme-dark .compose-sub-field {
  border-bottom-color: #3c4043;
}
html.theme-dark .compose-sub-cancel {
  color: #9aa0a6;
}
html.theme-dark .compose-sub-cancel:hover {
  background: #3c4043;
  color: #e8eaed;
}
html.theme-dark .compose-emoji-btn:hover {
  background: #3c4043;
}
.compose-tool-row .compose-icon-btn:hover:not(:disabled) {
  background: #f1f3f4;
  color: #202124;
}
.compose-tool-row .compose-icon-btn.on {
  color: var(--red);
  background: color-mix(in srgb, var(--red) 10%, transparent);
}
.compose-tool-row .compose-icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.compose-discard {
  color: #5f6368;
  margin-left: auto;
}
.compose-discard:hover {
  background: #f1f3f4;
  color: var(--red);
}
html.theme-dark .compose-window {
  background: #2d2e30;
  border-color: #5f6368;
  color: #e8eaed;
}
html.theme-dark .compose-head {
  background: #1f1f1f;
  color: #e8eaed;
}
html.theme-dark .compose-head h2 {
  color: #e8eaed;
}
html.theme-dark .compose-head .compose-icon-btn {
  color: #e8eaed;
}
html.theme-dark .compose-head .compose-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
html.theme-dark .compose-from-row,
html.theme-dark .compose-field-row {
  border-bottom-color: #5f6368;
}
html.theme-dark .compose-from-label,
html.theme-dark .compose-field-label,
html.theme-dark .compose-text-toggle {
  color: #9aa0a6;
}
html.theme-dark .compose-from-value,
html.theme-dark .compose-field-input,
html.theme-dark .compose-chip-input,
html.theme-dark .compose-body-input {
  color: #e8eaed;
}
html.theme-dark .compose-chip {
  background: #394457;
  color: #aecbfa;
}
html.theme-dark .compose-chip-remove {
  color: #aecbfa;
}
html.theme-dark .compose-chip-remove:hover {
  background: rgba(174, 203, 250, 0.16);
}
html.theme-dark .compose-chip.invalid {
  background: #5c2b29;
  color: #f28b82;
}
html.theme-dark .compose-chip.invalid .compose-chip-remove {
  color: #f28b82;
}
html.theme-dark .compose-body-area,
html.theme-dark .compose-fields,
html.theme-dark .compose-foot {
  background: #2d2e30;
}
html.theme-dark .compose-locked-hint {
  background: #5f6368;
  color: #e8eaed;
}
html.theme-dark .compose-sig-preview,
html.theme-dark .compose-quote-preview {
  background: #3c4043;
  border-color: #5f6368;
}
html.theme-dark .compose-locked-badge {
  color: #bdc1c6;
}
html.theme-dark .compose-quote-header {
  color: #9aa0a6;
}
html.theme-dark .compose-sig-preview-html,
html.theme-dark .compose-quote-body {
  color: #e8eaed;
}
html.theme-dark .compose-quote-body {
  border-left-color: #5f6368;
}
/* Email HTML often forces black text / white fills — neutralize in dark compose. */
html.theme-dark .compose-sig-preview-html *:not(a),
html.theme-dark .compose-quote-body *:not(a) {
  color: inherit !important;
  background-color: transparent !important;
}
html.theme-dark .compose-sig-preview-html a,
html.theme-dark .compose-quote-body a {
  color: #f28b82 !important;
}
html.theme-dark .compose-format-bar {
  background: #3c4043;
}
html.theme-dark .compose-fmt-btn {
  color: #e8eaed;
}
html.theme-dark .compose-send-menu {
  background: #2d2e30;
  border-color: #5f6368;
}
html.theme-dark .compose-send-menu button {
  color: #e8eaed;
}
html.theme-dark .compose-send-menu button:hover,
html.theme-dark .compose-tool-row .compose-icon-btn:hover:not(:disabled),
html.theme-dark .compose-discard:hover {
  background: #3c4043;
}

@media (max-width: 640px) {
  .compose-backdrop.dialog-backdrop {
    padding: 0;
    place-items: stretch;
    justify-content: stretch;
    align-items: stretch;
  }
  .compose-window,
  .compose-window.expanded,
  .compose-window.minimized {
    width: 100%;
    height: 100%;
    max-height: 100dvh;
    border-radius: 0;
  }
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.form-error { color: var(--red-dark); font-size: 0.9rem; }
.form-ok { color: #1f7a4d; font-size: 0.9rem; }

.wm-body { height: 100dvh; overflow: hidden; }
.wm-app {
  display: flex;
  flex-direction: row;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}
.wm-side {
  width: var(--side-w);
  flex-shrink: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-right: 1px solid var(--border);
  padding: 1rem 0.65rem 1rem 0;
  overflow: hidden;
}
.wm-side-brand {
  margin: 0.15rem 0.5rem 1.15rem 1.15rem;
  align-self: flex-start;
  flex-shrink: 0;
}
.wm-side-brand.has-domain-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  width: calc(100% - 0.65rem);
  margin: 0.15rem 0 1.15rem 0.65rem;
  align-self: stretch;
  box-sizing: border-box;
}
.wm-side-brand.has-domain-logo .brand-logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100px;
  margin: 0 auto;
  object-fit: contain;
}
.wm-side .btn-compose {
  width: calc(100% - 0.65rem);
  margin-left: 0.65rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}
.wm-nav-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 0.5rem;
}
.wm-nav-sec {
  margin-top: 0.85rem;
  padding-top: 0.35rem;
}
.wm-nav-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  padding: 0.25rem 0.35rem 0.35rem 1.15rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5f6368;
}
.btn-nav-add {
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
}
.btn-nav-add .material-symbols-outlined { font-size: 1.15rem; }
.wm-nav-item .wm-swatch {
  width: 0.75rem;
  height: 0.75rem;
  min-width: 0.75rem;
  max-width: 0.75rem;
  border-radius: 50%;
  flex: 0 0 0.75rem;
  flex-shrink: 0;
  margin-left: 0.2rem;
  margin-right: 0.2rem;
  align-self: center;
  box-sizing: border-box;
}
.wm-nav-item .wm-nav-edit {
  margin-left: auto;
  opacity: 0;
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.wm-nav-item:hover .wm-nav-edit,
.wm-nav-item:focus-within .wm-nav-edit { opacity: 1; }
.wm-nav-item .wm-nav-edit:hover { color: var(--dark); background: rgba(0, 0, 0, 0.06); }
.wm-nav-item .wm-nav-edit .material-symbols-outlined { font-size: 1.05rem; }
html.theme-dark .wm-nav-item .wm-nav-edit:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.wm-label-chips {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.22rem;
  min-width: 0;
  width: 100%;
  height: 0.55rem;
  overflow: hidden;
}
.wm-label-chip {
  display: block;
  flex: 0 0 0.55rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
}
.wm-color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.wm-color-swatch {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.wm-color-swatch.selected {
  border-color: var(--dark);
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--dark);
}
html.theme-dark .wm-color-swatch.selected {
  border-color: var(--red);
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--red);
}
.wm-bulk-label-menu .wm-label-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.65rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  font: inherit;
  box-sizing: border-box;
}
.wm-bulk-label-menu .wm-label-check:hover { background: var(--bg); }
.wm-bulk-label-menu .wm-label-cb {
  opacity: 1;
  filter: none;
  flex-shrink: 0;
}
.wm-bulk-label-menu .wm-label-check .wm-swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.wm-bulk-label-menu .wm-label-check .wm-nav-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wm-side-backdrop { display: none; }
.wm-right {
  flex: 1;
  min-width: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}
.wm-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 3.6rem;
  padding: 0 1rem;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 20;
}
.btn-nav { display: none !important; }
.wm-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 720px;
  margin: 0;
  margin-right: auto;
  background: #f2f6fc;
  border-radius: 1.5rem;
  padding: 0.35rem 0.9rem;
  color: var(--text-muted);
}
.wm-search input {
  border: 0;
  background: transparent;
  padding: 0.4rem 0;
  box-shadow: none;
}
.wm-search input:focus { box-shadow: none; border: 0; }
html.theme-dark .wm-search {
  background: #1f1f1f;
}
.wm-avatar-wrap { position: relative; }
.wm-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 0;
  background: var(--dark);
  color: var(--on-dark);
  font-family: var(--font-display);
  font-weight: 700;
  cursor: pointer;
}
html.theme-dark .wm-avatar { background: var(--red); }
.wm-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 200px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow);
  padding: 0.5rem;
  z-index: 40;
}
.wm-menu-email {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.35rem 0.5rem 0.55rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.3rem;
  word-break: break-all;
}
.wm-menu a, .wm-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.45rem 0.5rem;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.3;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius-btn);
}
.wm-menu a:hover, .wm-menu button:hover { background: var(--row-hover); }

.wm-nav { display: flex; flex-direction: column; gap: 0.1rem; }
.wm-nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 2rem;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  padding: 0.4rem 1rem 0.4rem 1.35rem;
  border-radius: 0 1.5rem 1.5rem 0;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.15rem;
  color: #3c4043;
  cursor: pointer;
  text-align: left;
}
.wm-nav-item > span[data-i18n],
.wm-nav-item > .wm-nav-text { flex: 1; min-width: 0; }
.wm-nav-count {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: inherit;
  font-variant-numeric: tabular-nums;
  line-height: 1.15rem;
}
.wm-nav-item .material-symbols-outlined {
  font-size: 1.15rem;
  color: inherit;
  flex: 0 0 1.15rem;
  width: 1.15rem;
  height: 1.15rem;
  display: grid;
  place-items: center;
}
.wm-nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #202124;
}
.wm-nav-item.active {
  background: #e8eaed;
  color: #202124;
  font-weight: 600;
}
.wm-nav-item.active:hover {
  background: #e8eaed;
  color: #202124;
}
html.theme-dark .wm-nav-item {
  color: rgba(255, 255, 255, 0.55);
}
html.theme-dark .wm-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #e8ecef;
}
html.theme-dark .wm-nav-item.active,
html.theme-dark .wm-nav-item.active:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.wm-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  /* Profile avatar size; gap between avatar and from */
  --toolbar-btn: 2.25rem;
  --avatar-size: 2.25rem;
  --avatar-gap: 0.5rem;
  --avatar-inset: 0.85rem;
  --read-col: calc(1rem + var(--avatar-size) + var(--avatar-gap) + var(--avatar-inset));
}
.wm-list-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.wm-mail-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  overflow: hidden;
  z-index: 4;
  pointer-events: none;
  background: transparent;
}
.wm-mail-progress[hidden] {
  display: none !important;
}
.wm-mail-progress-bar {
  display: block;
  height: 100%;
  width: 36%;
  border-radius: 99px;
  background: var(--red);
  animation: wm-mail-indet 1.05s var(--ease-out) infinite;
}
@keyframes wm-mail-indet {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(380%); }
}
.wm-mail-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  pointer-events: none;
}
.wm-mail-loading.hidden {
  display: none !important;
}
.wm-mail-spinner {
  width: 1.65rem;
  height: 1.65rem;
  border: 2.5px solid color-mix(in srgb, var(--red) 22%, transparent);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: compose-send-spin 0.65s linear infinite;
}
.wm-mail-loading-text {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}
.wm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: 2.75rem;
  padding: 0 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.wm-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-left: calc(1.25rem + 0.35rem);
}
.wm-toolbar-read {
  padding-left: var(--avatar-inset);
  gap: var(--avatar-gap);
}
.wm-tool-check {
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.75rem;
  flex-shrink: 0;
  cursor: pointer;
}
.wm-bulk-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.btn-empty-trash {
  height: 2rem;
  padding: 0 0.7rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  border-radius: var(--radius-btn);
}
.btn-empty-trash:hover {
  color: var(--red);
  background: var(--brand-faint);
}
.btn-empty-trash.hidden {
  display: none !important;
}
.wm-bulk-folder { position: relative; }
.wm-bulk-folder-menu { left: 0; right: auto; }
.wm-tool-check input,
.msg-check {
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  width: 1rem;
  height: 1rem;
  margin: 0;
  padding: 0;
  min-width: 1rem;
  max-width: 1rem;
  min-height: 1rem;
  max-height: 1rem;
  border: 1.5px solid var(--icon-muted);
  border-radius: 2px;
  background: transparent;
  justify-self: start;
  align-self: center;
  accent-color: var(--icon-muted);
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.15s var(--ease-out), border-color 0.15s var(--ease-out), background-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}
/* Small square hit pad — keep aspect ratio so focus ring stays circular/square */
.msg-row > .msg-check {
  position: relative;
}
.msg-row > .msg-check::before {
  content: "";
  position: absolute;
  inset: -0.35rem;
  border-radius: 4px;
}
.wm-tool-check input:hover,
.msg-check:hover,
.msg-row:hover .msg-check {
  opacity: 1;
  border-color: var(--icon-hover);
}
.wm-tool-check input:checked,
.msg-check:checked {
  opacity: 1;
  border-color: var(--red);
  background-color: var(--red);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E");
  background-size: 0.75rem 0.75rem;
  background-position: center;
  background-repeat: no-repeat;
}
.wm-tool-check input:focus,
.wm-tool-check input:focus-visible,
.msg-check:focus,
.msg-check:focus-visible {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 2px var(--brand-soft);
}
.wm-tool-more { position: relative; }
.wm-tool-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 0.25rem);
  min-width: 220px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow);
  padding: 0.35rem;
  z-index: 35;
}
.wm-tool-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.6rem 0.7rem;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius-btn);
}
.wm-tool-menu button:hover { background: var(--row-hover); }
.wm-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  margin-left: auto;
}
.wm-toolbar-read-actions {
  display: none;
  align-items: center;
  gap: 0.1rem;
  margin-left: auto;
  flex-shrink: 0;
}
.wm-toolbar-read-actions .wm-read-actions {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}
.wm-toolbar-read-actions .btn-icon,
.wm-toolbar-read-actions .icon-toggle {
  min-width: var(--toolbar-btn, 2.25rem);
  width: var(--toolbar-btn, 2.25rem);
  height: var(--toolbar-btn, 2.25rem);
}
.wm-toolbar-read-actions .material-symbols-outlined {
  font-size: 1.35rem;
}
.wm-toolbar-read-actions.hidden {
  display: none !important;
}
.wm-toolbar-right .btn-icon:disabled {
  opacity: 0.35;
  cursor: default;
}
.wm-toolbar-right .btn-icon:disabled:hover {
  background: transparent;
  color: var(--text-muted);
}
.wm-paging-wrap { position: relative; }
.wm-paging {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  border: 0;
  background: transparent;
  padding: 0.35rem 0.45rem;
  border-radius: var(--radius-btn);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
}
.wm-paging:hover { background: var(--row-hover); color: var(--dark); }
.wm-paging .material-symbols-outlined { font-size: 1.25rem; }
.wm-paging-menu {
  left: auto;
  right: 0;
}
.wm-paging-menu button.active {
  color: var(--red);
  font-weight: 600;
}
.wm-toast {
  position: fixed;
  left: 50%;
  top: 1.25rem;
  bottom: auto;
  transform: translateX(-50%);
  z-index: 80;
  padding: 0.7rem 1.15rem;
  background: var(--dark);
  color: var(--on-dark);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  pointer-events: none;
  max-width: min(28rem, calc(100vw - 2rem));
  text-align: center;
}
.wm-toast.wm-toast-error {
  background: var(--red);
  color: #fff;
}
html.theme-dark .wm-toast {
  background: #e8ecef;
  color: #12181c;
}
html.theme-dark .wm-toast.wm-toast-error {
  background: var(--red);
  color: #fff;
}
.wm-ptr {
  display: none;
  flex-shrink: 0;
  height: 0;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  pointer-events: none;
}
.wm-ptr .wm-ptr-icon {
  font-size: 1.5rem;
  transition: transform 0.12s var(--ease-out);
}
.wm-ptr.ready .wm-ptr-icon {
  color: var(--red);
}
.wm-ptr.refreshing .wm-ptr-icon {
  animation: wm-ptr-spin 0.75s linear infinite;
  color: var(--red);
}
@keyframes wm-ptr-spin {
  to { transform: rotate(360deg); }
}
.wm-list { flex: 1; overflow-y: auto; }
.msg-row.selected { background: var(--row-hover); }
.msg-row {
  display: grid;
  grid-template-columns: 1.25rem 1.15rem 1.5rem 1.5rem minmax(6.5rem, 11rem) minmax(0, 1fr) 3.25rem 3.75rem;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 1rem;
  min-height: 2.5rem;
  border-bottom: 1px solid var(--border);
  cursor: default;
  position: relative;
}
.msg-row.has-attach {
  --msg-meta-h: 2.35rem;
  grid-template-rows: var(--msg-meta-h) auto;
  align-items: stretch;
  row-gap: 0.2rem;
  padding-top: 0.4rem;
  padding-bottom: 0.5rem;
  min-height: 4rem;
}
.msg-row.has-attach > .msg-grip,
.msg-row.has-attach > .msg-check,
.msg-row.has-attach > .icon-toggle,
.msg-row.has-attach > .msg-from,
.msg-row.has-attach > .msg-subject-line,
.msg-row.has-attach > .wm-label-chips,
.msg-row.has-attach > .msg-time {
  grid-row: 1;
  box-sizing: border-box;
}
.msg-row.has-attach > .msg-from,
.msg-row.has-attach > .msg-subject-line,
.msg-row.has-attach > .wm-label-chips,
.msg-row.has-attach > .msg-time {
  height: var(--msg-meta-h);
  min-height: var(--msg-meta-h);
  max-height: var(--msg-meta-h);
  align-self: stretch;
}
.msg-row.has-attach > .msg-grip,
.msg-row.has-attach > .icon-toggle {
  display: grid;
  place-items: center;
  margin: 0;
  width: 100%;
  height: var(--msg-meta-h);
  min-height: var(--msg-meta-h);
  max-height: var(--msg-meta-h);
  align-self: stretch;
}
.msg-row.has-attach > .msg-check {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  max-width: 1rem;
  min-height: 1rem;
  max-height: 1rem;
  align-self: center;
  justify-self: center;
  margin: 0;
}
.msg-row.has-attach > .wm-label-chips {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  align-self: stretch;
  margin: 0;
  width: 100%;
  height: var(--msg-meta-h);
  min-height: var(--msg-meta-h);
  max-height: var(--msg-meta-h);
  box-sizing: border-box;
  grid-row: 1;
}
.msg-row.has-attach > .msg-from,
.msg-row.has-attach > .msg-subject-line,
.msg-row.has-attach > .msg-time {
  display: flex;
  align-items: center;
  margin: 0;
}
.msg-row.has-attach > .msg-time {
  justify-content: flex-end;
}
.msg-row.has-attach > .msg-attach-line {
  grid-column: 6;
  grid-row: 2;
  align-self: start;
  padding: 0 0 0.1rem;
  min-height: 1.15rem;
}
.msg-row:hover { background: var(--row-hover); }
.msg-row.unread { background: var(--unread-bg); }
.msg-row.unread:hover { background: var(--row-hover); }
.msg-row.unread .msg-from,
.msg-row.unread .msg-subject,
.msg-row.unread .msg-time {
  font-weight: 600;
  color: #000;
}
html.theme-dark .msg-row.unread .msg-from,
html.theme-dark .msg-row.unread .msg-subject,
html.theme-dark .msg-row.unread .msg-time {
  color: #fff;
}
.msg-grip {
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.5rem;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--icon-muted);
  cursor: grab;
  opacity: 0;
  transition: opacity 0.15s var(--ease-out), color 0.15s var(--ease-out);
  user-select: none;
  touch-action: none;
}
.msg-grip .material-symbols-outlined { font-size: 1.15rem; }
.msg-row:hover .msg-grip { opacity: 1; }
.msg-row:hover .msg-grip:hover { color: var(--icon-hover); }
.msg-grip:active { cursor: grabbing; }
.msg-row.no-drag .msg-grip {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}
.msg-row.dragging { opacity: 0.45; }
.wm-nav-item.drop-target {
  background: var(--brand-faint);
  color: #202124;
}
html.theme-dark .wm-nav-item.drop-target {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.msg-from {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  line-height: 1.25;
  cursor: pointer;
}
.msg-subject-line {
  display: flex;
  gap: 0.3rem;
  min-width: 0;
  overflow: hidden;
  font-size: 0.875rem;
  line-height: 1.25;
  cursor: pointer;
}
.msg-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; max-width: 45%; }
.msg-preview {
  color: var(--preview);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  font-weight: 400;
}
.msg-subject-line .msg-preview:not(:empty)::before {
  content: " — ";
}
.msg-attach-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.45rem;
  min-width: 0;
  font-size: 0.75rem;
  line-height: 1.2;
  color: var(--text-muted);
  cursor: pointer;
}
.msg-attach-line .material-symbols-outlined {
  font-size: 0.95rem;
  color: var(--icon-muted);
}
.msg-attach-name {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
}
a.msg-attach-name:hover {
  color: var(--red);
  border-bottom-color: var(--red);
}
.msg-time {
  font-size: 0.75rem;
  line-height: 1.25;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: right;
}
.msg-actions {
  display: none;
  gap: 0.15rem;
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--row-hover);
  padding-left: 0.35rem;
}
.msg-row.has-attach .msg-actions {
  top: 0.4rem;
  height: var(--msg-meta-h, 2.35rem);
  align-items: center;
  transform: none;
}
.msg-row:hover .msg-actions { display: flex; }
.msg-row:hover .msg-time { visibility: hidden; }
.msg-row .btn-icon {
  min-width: 1.75rem;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0.2rem;
}
.msg-row .btn-icon .material-symbols-outlined { font-size: 1.15rem; }
.icon-toggle {
  border: 0;
  background: transparent;
  color: var(--icon-muted);
  cursor: pointer;
  padding: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: grid;
  place-items: center;
  font-weight: 400;
  transition: color 0.15s var(--ease-out);
}
.icon-toggle .material-symbols-outlined { font-size: 1.15rem; }
.msg-row:hover .icon-toggle:not(.on),
.icon-toggle:hover { color: var(--icon-hover); }
.icon-toggle.on,
.icon-toggle.on:hover,
.msg-row:hover .icon-toggle.on {
  color: var(--star-gold);
}
.icon-toggle.on .material-symbols-outlined {
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
  font-optical-sizing: auto;
}
.msg-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.25;
}

.wm-read {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem 2rem;
  padding-left: var(--read-col);
}
.wm-read-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.wm-read-title-block {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.wm-read-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  min-width: 0;
}
.wm-read-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--dark);
  min-width: 0;
  word-break: break-word;
  line-height: 1.25;
}
.wm-read-important {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
  align-self: center;
  padding: 0.1rem 0.45rem 0.1rem 0.25rem;
  border-radius: 999px;
  background: rgba(251, 140, 0, 0.12);
  color: #e65100;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.15;
  height: 1.35rem;
  box-sizing: border-box;
}
.wm-read-important .material-symbols-outlined {
  font-size: 0.95rem;
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
}
html.theme-dark .wm-read-important {
  background: rgba(251, 140, 0, 0.2);
  color: #ffb74d;
}
.wm-read-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  width: 100%;
}
.wm-read-folder {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 0.2rem;
  max-width: 100%;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.15;
  height: 1.35rem;
  box-sizing: border-box;
}
.wm-read-folder .material-symbols-outlined {
  font-size: 0.95rem;
  color: var(--text-muted);
}
.wm-read-folder-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 14rem;
  color: var(--dark);
}
.wm-read-label {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  max-width: 100%;
  padding: 0 0.1rem 0 0.4rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--chip-color, var(--red)) 35%, var(--border));
  background: color-mix(in srgb, var(--chip-color, var(--red)) 12%, var(--paper));
  color: var(--dark);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  height: 1.35rem;
  box-sizing: border-box;
}
.wm-read-label-dot {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--chip-color, var(--red));
  flex-shrink: 0;
}
.wm-read-label-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 10rem;
}
.wm-read-label-remove {
  display: grid;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.wm-read-label-remove:hover {
  background: color-mix(in srgb, var(--chip-color, var(--red)) 18%, transparent);
  color: var(--dark);
}
.wm-read-label-remove .material-symbols-outlined {
  font-size: 0.85rem;
}
.wm-read-meta {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--avatar-gap);
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  /* Avatar hangs left; from/to stay on --read-col with subject/body/delete */
  margin-left: calc(-1 * (var(--avatar-size) + var(--avatar-gap)));
}
.wm-read-sender-avatar {
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--dark);
  color: var(--on-dark);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  user-select: none;
  align-self: center;
}
html.theme-dark .wm-read-sender-avatar {
  background: var(--red);
}
.wm-read-meta-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}
.wm-read-meta-aside {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem 0.35rem;
  flex-shrink: 0;
  margin-left: auto;
  align-self: center;
  max-width: min(22rem, 55%);
}
.wm-read-received {
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--text-muted);
  text-align: right;
}
.wm-read-actions {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex-shrink: 0;
}
.wm-read-actions .btn-icon,
.wm-read-actions .icon-toggle {
  min-width: 2rem;
  width: 2rem;
  height: 2rem;
  padding: 0.25rem;
}
.wm-read-actions .material-symbols-outlined {
  font-size: 1.2rem;
}
.wm-read-from-line {
  color: var(--dark);
  font-size: 0.95rem;
  line-height: 1.35;
  word-break: break-word;
}
.wm-read-from-line b {
  font-weight: 700;
}
.wm-read-from-email {
  color: var(--text-muted);
  font-weight: 400;
}
.wm-read-to-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem 0.35rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  position: relative;
}
.wm-read-to-label {
  color: var(--text-muted);
}
.wm-read-to {
  color: var(--dark);
  word-break: break-word;
}
.wm-read-details-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.wm-read-details-toggle {
  width: 1.6rem;
  height: 1.6rem;
  min-width: 1.6rem;
  padding: 0;
  color: var(--text-muted);
}
.wm-read-details-toggle .material-symbols-outlined {
  font-size: 1.35rem;
}
.wm-read-details-toggle[aria-expanded="true"] {
  color: var(--dark);
}
.wm-read-details {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  z-index: 20;
  min-width: min(22rem, 78vw);
  max-width: min(28rem, 92vw);
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--paper);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 0.75rem;
  font-size: 0.82rem;
  line-height: 1.35;
}
.wm-read-details.hidden { display: none; }
.wm-read-details dt {
  margin: 0;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}
.wm-read-details dd {
  margin: 0;
  color: var(--dark);
  word-break: break-word;
}
.wm-read-meta .wm-read-arrow {
  font-size: 1rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.wm-read-body {
  word-break: break-word;
  color: var(--dark);
}
.wm-read-body-plain {
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.55;
}
.wm-read-body-html {
  white-space: normal;
}
.wm-read-html-frame {
  display: block;
  width: 100%;
  min-height: 3rem;
  border: 0;
  background: transparent;
}
.wm-read-attachments {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.wm-read-attachments.hidden { display: none; }
.wm-read-attach-title {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.wm-read-attach-title .material-symbols-outlined {
  font-size: 1.05rem;
}
.wm-read-attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.wm-read-attach-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--paper);
  color: var(--dark);
  text-decoration: none;
  font-size: 0.82rem;
  line-height: 1.25;
  transition: border-color 0.15s var(--ease-out), background 0.15s var(--ease-out);
}
.wm-read-attach-item:hover {
  border-color: var(--red);
  background: var(--row-hover);
}
.wm-read-attach-item .material-symbols-outlined {
  font-size: 1.1rem;
  color: var(--icon-muted);
  flex-shrink: 0;
}
.wm-read-attach-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.wm-read-attach-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 16rem;
  font-weight: 600;
}
.wm-read-attach-size {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}
.wm-read-quote {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.wm-read-quote.hidden { display: none; }

.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(25, 33, 38, 0.45);
  display: none;
  place-items: center;
  padding: 1rem;
  z-index: 50;
}
.dialog-backdrop.open { display: grid; }
#confirmDialog { z-index: 60; }
.dialog.confirm-dialog {
  background: var(--paper);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  max-width: 420px;
  width: 100%;
  padding: 1.5rem 1.5rem 1.25rem;
}
.confirm-dialog .dialog-danger-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-btn);
  background: var(--brand-faint);
  color: var(--red);
  display: grid;
  place-items: center;
  margin-bottom: 0.85rem;
}
.confirm-dialog .dialog-danger-icon .material-symbols-outlined {
  font-size: 1.35rem;
}
.confirm-dialog h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--dark);
}
.confirm-dialog p {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}
.dialog-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.dialog-form {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  width: min(720px, 100%);
  max-height: min(90dvh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.dialog-form-head, .dialog-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.dialog-form-foot {
  border-bottom: 0;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}
.dialog-form-foot-spacer { flex: 1; min-width: 0; }
.dialog-form-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--dark);
}
.dialog-form-body { padding: 1rem 1.25rem; overflow: auto; flex: 1; }

.settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(25, 33, 38, 0.4);
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.settings-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  z-index: 56;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(25, 33, 38, 0.12);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  visibility: hidden;
}
.settings-panel.open {
  transform: translateX(0);
  visibility: visible;
}
.settings-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--paper);
  flex-shrink: 0;
}
.settings-panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--dark);
}
.settings-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1rem 2rem;
  overscroll-behavior: contain;
}
.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
}
.card h2,
.card h3 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--dark);
}
.radio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0;
  font-size: 0.95rem;
}
.radio input { width: auto; accent-color: var(--red); }
.settings-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--dark);
  cursor: pointer;
}
.settings-check input {
  width: auto;
  margin: 0.2rem 0 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  accent-color: var(--red);
  flex-shrink: 0;
  box-shadow: none;
}
.settings-check input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.settings-check:has(input:disabled) {
  cursor: not-allowed;
  color: var(--text-muted);
}
.settings-status {
  margin: 0.7rem 0 0;
  font-size: 0.88rem;
  line-height: 1.4;
}
.settings-actions[hidden] {
  display: none !important;
}
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.update-banner {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
}
.update-banner[hidden] {
  display: none !important;
}
#btnUpdateNow[hidden],
.update-banner .btn[hidden] {
  display: none !important;
}
.update-banner p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--dark);
}
.update-progress {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dark);
}
.update-progress[hidden] {
  display: none !important;
}
.update-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(25, 33, 38, 0.2);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: compose-send-spin 0.65s linear infinite;
  flex-shrink: 0;
}
html.theme-dark .update-spinner {
  border-color: rgba(255, 255, 255, 0.25);
  border-top-color: var(--red-bright, var(--red));
}
html.theme-dark .update-banner {
  background: rgba(255, 255, 255, 0.04);
}
.page-actions { margin-top: 0.5rem; }
.alias-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.alias-list li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  word-break: break-all;
}
.alias-list li:last-child { border-bottom: none; }

@media (max-width: 1079px) {
  .btn-nav { display: grid !important; place-items: center; }
  .wm-side {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 30;
    transform: translateX(-105%);
    transition: transform 0.25s var(--ease-out);
    width: min(280px, 86%);
    height: 100dvh;
  }
  .wm-side.open { transform: translateX(0); }
  .wm-side-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(25, 33, 38, 0.4);
    z-index: 25;
  }
  .wm-search { max-width: none; }

  .wm-ptr {
    display: flex;
  }
  .wm-list {
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* List toolbar: refresh + paging + prev/next */
  #toolbarListLeft:not(.hidden) {
    display: flex !important;
    padding-left: 0;
    min-width: 0;
  }
  #toolbarListLeft.hidden {
    display: none !important;
  }
  #toolbarReadLeft:not(.hidden) {
    display: flex !important;
    padding-left: 0;
    min-width: 0;
    flex: 1;
    justify-content: flex-start;
    gap: 0.35rem;
  }
  #toolbarReadLeft.hidden {
    display: none !important;
  }
  #toolbarReadRight:not(.hidden) {
    display: flex !important;
    margin-left: auto;
    width: auto;
    flex-shrink: 0;
    justify-content: flex-end;
  }
  #toolbarReadRight.hidden {
    display: none !important;
  }
  #toolbarRight:not(.hidden) {
    display: flex !important;
  }
  #toolbarRight.hidden {
    display: none !important;
  }
  #toolbarListLeft .wm-tool-check,
  #toolbarListLeft .wm-bulk-actions,
  #toolbarListLeft .wm-tool-more {
    display: none !important;
  }
  .wm-toolbar {
    justify-content: space-between;
    padding: 0 0.65rem;
    gap: 0.5rem;
  }
  .wm-toolbar-right {
    margin-left: auto;
    width: auto;
    flex-shrink: 0;
    justify-content: flex-end;
  }

  /* Mobile list row: from · labels · time | subject + preview | attachment */
  .msg-row {
    grid-template-columns: minmax(0, 1fr) auto minmax(3.75rem, max-content);
    grid-template-rows: auto auto;
    align-items: center;
    gap: 0.2rem 0.15rem;
    padding: 0.55rem 0.85rem;
    min-height: 0;
  }
  .msg-row .msg-grip,
  .msg-row .msg-check,
  .msg-row .icon-toggle,
  .msg-row .msg-actions {
    display: none !important;
  }
  .msg-row:hover .msg-time {
    visibility: visible;
  }
  .msg-from {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  .wm-label-chips {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    min-width: 0;
    max-width: 3.5rem;
    height: auto;
    justify-content: flex-end;
  }
  .msg-time {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    text-align: end;
  }
  .msg-subject-line {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    align-self: stretch;
    width: 100%;
    gap: 0.12rem;
    cursor: pointer;
    text-align: left;
  }
  .msg-subject {
    width: 100%;
    max-width: 100%;
    flex-shrink: 1;
    align-self: stretch;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .msg-preview {
    width: 100%;
    max-width: 100%;
    flex: none;
    align-self: stretch;
    text-align: left;
    font-size: 0.8125rem;
    line-height: 1.3;
    white-space: nowrap;
  }
  .msg-subject-line .msg-preview:not(:empty)::before {
    content: none;
  }
  .msg-row.has-attach {
    grid-template-rows: auto auto auto;
    row-gap: 0.2rem;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    min-height: 0;
  }
  .msg-row.has-attach > .msg-grip,
  .msg-row.has-attach > .msg-check,
  .msg-row.has-attach > .icon-toggle,
  .msg-row.has-attach > .msg-from,
  .msg-row.has-attach > .msg-subject-line,
  .msg-row.has-attach > .wm-label-chips,
  .msg-row.has-attach > .msg-time {
    height: auto;
    min-height: 0;
    max-height: none;
    align-self: center;
  }
  .msg-row.has-attach > .msg-from,
  .msg-row.has-attach > .wm-label-chips,
  .msg-row.has-attach > .msg-time {
    grid-row: 1;
  }
  .msg-row.has-attach > .msg-subject-line {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    align-self: stretch;
    width: 100%;
  }
  .msg-row.has-attach > .msg-attach-line {
    grid-column: 1 / -1;
    grid-row: 3;
    padding: 0;
    min-height: 0;
  }
  .msg-row.has-attach .msg-actions {
    display: none !important;
  }

  /* Read view: back/actions left, star/reply/forward right */
  .wm-toolbar:has(#toolbarReadLeft:not(.hidden)) {
    justify-content: space-between;
    padding: 0 0.65rem;
  }
  .wm-read {
    padding: 0.75rem 0.85rem 1.5rem;
  }
  .wm-read-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
  }
  .wm-read-title-block {
    width: 100%;
    align-items: flex-start;
  }
  .wm-read-title-row {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 0.35rem;
  }
  .wm-read-head h2 {
    width: 100%;
    text-align: left;
    font-size: 1.15rem;
  }
  .wm-read-folder,
  .wm-read-important {
    align-self: flex-start;
  }
  .wm-read-tags {
    justify-content: flex-start;
    width: 100%;
  }
  /* Mobile read header layout.
     Row 1: avatar (col 1) | actions (col 3)
     Row 2: from line (full width)
     Row 3: kepada (col 1) | address (col 2) | dropdown button (col 3)
     Row 4: details panel (full width, when expanded)
     Row 5: received timestamp (full width) */
  .wm-read-meta {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    margin-left: 0;
    margin-bottom: 1rem;
    gap: 0.15rem 0.4rem;
    width: 100%;
  }
  .wm-read-sender-avatar {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.85rem;
  }
  /* Flatten containers so inner items become direct grid children. */
  .wm-read-meta-text,
  .wm-read-meta-aside,
  .wm-read-details-wrap,
  .wm-read-to-line {
    display: contents;
  }
  /* Star/reply/forward: row 1, col 3. */
  .wm-read-actions {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.15rem;
  }
  /* From line: row 2, full width. */
  .wm-read-from-line {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    text-align: left;
    margin-top: 0.45rem;
  }
  /* "kepada" label: row 3, col 1. */
  .wm-read-to-label {
    grid-column: 1;
    grid-row: 3;
    text-align: left;
  }
  /* Address: row 3, col 2 (takes remaining space). */
  .wm-read-to {
    grid-column: 2;
    grid-row: 3;
    min-width: 0;
    text-align: left;
  }
  /* Dropdown toggle button: row 3, col 3 — same row as label and address. */
  .wm-read-details-toggle {
    grid-column: 3;
    grid-row: 3;
    justify-self: end;
  }
  /* Details panel: row 4, full width. */
  .wm-read-details {
    grid-column: 1 / -1;
    grid-row: 4;
    position: static;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 0.35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
  }
  .wm-read-details.hidden {
    display: none;
  }
  /* Received timestamp: row 5, full width. */
  .wm-read-received {
    grid-column: 1 / -1;
    grid-row: 5;
    width: 100%;
    text-align: left;
    margin-top: 0;
  }

  /* Mobile FAB: compose button is moved to <body> on boot so it can
     position:fixed without being trapped by .wm-side's transform. */
  .btn-compose.btn-compose-fab {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    min-width: 3.5rem;
    padding: 0;
    border-radius: 50%;
    z-index: 35;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    margin: 0;
  }
  .btn-compose.btn-compose-fab .btn-compose-text {
    display: none;
  }
  .btn-compose.btn-compose-fab .btn-compose-icon {
    font-size: 1.5rem;
  }
  /* Hide FAB while side drawer is open so it doesn't sit on top. */
  .btn-compose.btn-compose-fab.fab-hidden {
    display: none;
  }
}

