/* ============================================================
   Courier — design tokens
   ============================================================ */
:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Instrument Serif", ui-serif, Georgia, serif;

  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eef0f7;
  --hover: rgba(17, 24, 54, 0.045);
  --border: rgba(17, 24, 54, 0.08);
  --border-strong: rgba(17, 24, 54, 0.14);
  --text: #12162b;
  --text-2: #4b5270;
  --text-3: #8a90a8;
  --accent: #5a4cf5;
  --accent-2: #9b5cf6;
  --accent-3: #e05cc8;
  --accent-ink: #ffffff;
  --accent-soft: rgba(90, 76, 245, 0.09);
  --accent-softer: rgba(90, 76, 245, 0.05);
  --accent-text: #4b3de0;
  --selected: rgba(90, 76, 245, 0.08);
  --danger: #e5484d;
  --danger-soft: rgba(229, 72, 77, 0.1);
  --success: #2f9e6b;
  --success-soft: rgba(47, 158, 107, 0.12);
  --warn: #d48806;
  --star: #f5a524;
  --unread: #5a4cf5;
  --shadow-sm: 0 1px 2px rgba(17, 24, 54, 0.06);
  --shadow-md: 0 4px 16px -4px rgba(17, 24, 54, 0.12), 0 2px 4px rgba(17, 24, 54, 0.04);
  --shadow-lg: 0 24px 64px -16px rgba(17, 24, 54, 0.28), 0 8px 20px -8px rgba(17, 24, 54, 0.12);
  --ring: 0 0 0 3px rgba(90, 76, 245, 0.25);
  --gradient: linear-gradient(135deg, #5a4cf5 0%, #9b5cf6 55%, #e05cc8 100%);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --sidebar-w: 252px;
  --list-w: 400px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #090a10;
    --surface: #10121b;
    --surface-2: #141724;
    --surface-3: #1b1f2e;
    --hover: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.13);
    --text: #eceef7;
    --text-2: #a5abc4;
    --text-3: #6b7290;
    --accent: #7d72ff;
    --accent-2: #a77bff;
    --accent-soft: rgba(125, 114, 255, 0.14);
    --accent-softer: rgba(125, 114, 255, 0.07);
    --accent-text: #a9a2ff;
    --selected: rgba(125, 114, 255, 0.12);
    --danger: #ff6369;
    --danger-soft: rgba(255, 99, 105, 0.13);
    --success: #3dd68c;
    --success-soft: rgba(61, 214, 140, 0.12);
    --unread: #8b82ff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 20px -6px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --ring: 0 0 0 3px rgba(125, 114, 255, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #090a10;
  --surface: #10121b;
  --surface-2: #141724;
  --surface-3: #1b1f2e;
  --hover: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #eceef7;
  --text-2: #a5abc4;
  --text-3: #6b7290;
  --accent: #7d72ff;
  --accent-2: #a77bff;
  --accent-soft: rgba(125, 114, 255, 0.14);
  --accent-softer: rgba(125, 114, 255, 0.07);
  --accent-text: #a9a2ff;
  --selected: rgba(125, 114, 255, 0.12);
  --danger: #ff6369;
  --danger-soft: rgba(255, 99, 105, 0.13);
  --success: #3dd68c;
  --success-soft: rgba(61, 214, 140, 0.12);
  --unread: #8b82ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 20px -6px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --ring: 0 0 0 3px rgba(125, 114, 255, 0.35);
  color-scheme: dark;
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "ss03";
  overflow: hidden;
}
[hidden] { display: none !important; }
html { -webkit-tap-highlight-color: transparent; }
@media (display-mode: standalone) { body { overscroll-behavior: none; user-select: none; -webkit-user-select: none; } .mail, .editor, input, textarea, .mail-text { user-select: text; -webkit-user-select: text; } }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent-text); }
kbd {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  color: var(--text-3);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
}
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }
.recips input:focus-visible, .c-row input:focus-visible, .c-row select:focus-visible, .search input:focus-visible,
.input-wrap input:focus-visible, .editor:focus-visible, .ai-panel input:focus-visible { box-shadow: none; }
::selection { background: var(--accent-soft); }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }
.ml-auto { margin-left: auto; }
.only-mobile { display: none !important; }
.scrim { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

/* ============================================================
   Buttons & inputs
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-weight: 550;
  font-size: 13.5px;
  white-space: nowrap;
  transition: background 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.12s var(--ease), color 0.15s;
  user-select: none;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary {
  color: var(--accent-ink);
  background: var(--gradient);
  background-size: 140% 140%;
  background-position: 0% 50%;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 6px 18px -6px rgba(90, 76, 245, 0.6);
}
.btn-primary:hover:not(:disabled) { background-position: 100% 50%; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 24px -8px rgba(90, 76, 245, 0.7); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--hover); color: var(--text); }
.btn-soft { background: var(--surface-3); color: var(--text); border: 1px solid var(--border); }
.btn-soft:hover { background: var(--hover); border-color: var(--border-strong); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-block { width: 100%; }
.btn-lg { height: 44px; font-size: 14.5px; border-radius: 12px; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
  flex: none;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.is-active { color: var(--accent-text); background: var(--accent-soft); }
.icon-btn[disabled] { opacity: 0.4; pointer-events: none; }

.field { display: grid; gap: 6px; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field-hint { font-size: 12px; color: var(--text-3); }
.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-3);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.input-wrap:focus-within { border-color: var(--accent); box-shadow: var(--ring); background: var(--surface); }
.input-wrap input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); }
.input, .textarea, .select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 9px 12px;
  outline: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: var(--ring); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }

/* toggle switch */
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 22px; background: var(--surface-3); border: 1px solid var(--border-strong); transition: background 0.2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.22s var(--ease); }
.switch input:checked + span { background: var(--accent); border-color: transparent; }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: var(--ring); }

/* ============================================================
   Brand
   ============================================================ */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--gradient);
  box-shadow: 0 6px 16px -6px rgba(90, 76, 245, 0.7), 0 1px 0 rgba(255, 255, 255, 0.3) inset;
}
.brand-mark svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font-family: var(--font-display); font-size: 25px; letter-spacing: -0.01em; line-height: 1; }
.brand-lg .brand-mark { width: 44px; height: 44px; border-radius: 14px; }
.brand-lg .brand-mark svg { width: 26px; height: 26px; }
.brand-lg .brand-name { font-size: 34px; }

/* ============================================================
   Login
   ============================================================ */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; overflow: hidden; background: var(--bg); }
.aurora { position: absolute; inset: -20%; filter: blur(70px); opacity: 0.55; pointer-events: none; }
.aurora span { position: absolute; border-radius: 50%; animation: drift 18s ease-in-out infinite alternate; }
.aurora span:nth-child(1) { width: 46vmax; height: 46vmax; left: 8%; top: 4%; background: #5a4cf5; }
.aurora span:nth-child(2) { width: 38vmax; height: 38vmax; right: 6%; top: 22%; background: #e05cc8; animation-delay: -6s; opacity: 0.7; }
.aurora span:nth-child(3) { width: 34vmax; height: 34vmax; left: 30%; bottom: 0; background: #38bdf8; animation-delay: -12s; opacity: 0.5; }
@keyframes drift { to { transform: translate(6vmax, -4vmax) scale(1.12); } }
.login-card {
  position: relative;
  width: min(420px, 100%);
  padding: 36px 32px 26px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 18px;
  animation: rise 0.6s var(--ease) both;
}
.login-title { margin: 6px 0 -10px; font-size: 26px; letter-spacing: -0.025em; font-weight: 650; }
.login-sub { margin: 0; color: var(--text-2); }
.login-error { margin: -6px 0 -4px; min-height: 18px; color: var(--danger); font-size: 13px; font-weight: 500; }
.login-foot { margin: 4px 0 0; text-align: center; color: var(--text-3); font-size: 12px; }
.login-card.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.98); } }

/* ============================================================
   App shell
   ============================================================ */
.app {
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-w) var(--list-w) minmax(0, 1fr);
  gap: 0;
}

/* sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px 12px 12px;
  gap: 10px;
}
.sidebar-top { display: grid; gap: 18px; padding: 0 6px; }
.btn-compose {
  height: 46px;
  border-radius: 14px;
  justify-content: flex-start;
  padding: 0 14px 0 16px;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  background: var(--gradient);
  background-size: 150% 150%;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset, 0 10px 24px -10px rgba(90, 76, 245, 0.8);
}
.btn-compose:hover { background-position: 100% 0; }
.btn-compose kbd { margin-left: auto; background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.22); color: #fff; }
.nav { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 2px; padding: 6px 0; }
.nav-section { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); padding: 16px 12px 6px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-2);
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }
.nav-item.is-active .icon { color: var(--accent); }
.nav-item.drop-target { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.nav-count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.nav-count.is-unread { color: var(--accent-ink); background: var(--accent); padding: 1px 8px; border-radius: 20px; font-size: 11.5px; }

.sidebar-bottom { display: grid; gap: 6px; border-top: 1px solid var(--border); padding-top: 10px; }
.account { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; text-align: left; transition: background 0.15s; color: var(--text-3); }
.account:hover { background: var(--hover); }
.account-meta { display: grid; min-width: 0; flex: 1; }
.account-name { font-weight: 600; color: var(--text); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-email { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-tools { display: flex; align-items: center; gap: 2px; padding: 0 2px; }
.live { display: inline-flex; align-items: center; gap: 7px; margin-right: auto; padding: 0 8px; font-size: 12px; color: var(--text-3); }
.app-version { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; margin-right: 4px; letter-spacing: 0.02em; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.live.is-on i { background: var(--success); box-shadow: 0 0 0 0 var(--success-soft); animation: pulse 2.4s infinite; }
.live.is-off i { background: var(--warn); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47, 158, 107, 0.45); } 70% { box-shadow: 0 0 0 7px rgba(47, 158, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 158, 107, 0); } }

/* avatars */
.avatar {
  --h: 250;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: hsl(var(--h) 70% 30%);
  background: linear-gradient(140deg, hsl(var(--h) 90% 88%), hsl(calc(var(--h) + 40) 85% 80%));
  user-select: none;
}
:root[data-theme="dark"] .avatar { color: hsl(var(--h) 90% 88%); background: linear-gradient(140deg, hsl(var(--h) 45% 32%), hsl(calc(var(--h) + 40) 45% 26%)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .avatar { color: hsl(var(--h) 90% 88%); background: linear-gradient(140deg, hsl(var(--h) 45% 32%), hsl(calc(var(--h) + 40) 45% 26%)); }
}
.avatar-sm { width: 32px; height: 32px; font-size: 12.5px; }
.avatar-lg { width: 42px; height: 42px; font-size: 15px; }

/* ============================================================
   Message list
   ============================================================ */
.list-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 10px 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  border-right: 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.list-header { position: relative; padding: 16px 16px 10px; display: grid; gap: 12px; border-bottom: 1px solid var(--border); }
.list-title-row { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.list-title { margin: 0; font-size: 21px; letter-spacing: -0.025em; font-weight: 650; }
.list-count { color: var(--text-3); font-size: 13px; font-weight: 500; padding-top: 3px; }
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px 0 12px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-3);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.search:focus-within { border-color: var(--accent); box-shadow: var(--ring); background: var(--surface); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); height: 100%; }
.search input::-webkit-search-cancel-button { filter: grayscale(1); opacity: 0.5; }
.search:focus-within kbd { display: none; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip {
  height: 28px;
  padding: 0 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-2);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.is-active { background: var(--text); color: var(--surface); border-color: var(--text); }

.bulkbar {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: var(--surface);
  animation: fade 0.18s var(--ease);
  border-bottom: 1px solid var(--border);
}
.bulk-count { font-weight: 600; }
.bulk-actions { margin-left: auto; display: flex; gap: 2px; }

.list-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.message-list { list-style: none; margin: 0; padding: 6px; display: grid; gap: 1px; }
.msg {
  --tint: transparent;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  outline: none;
  animation: fade 0.25s var(--ease) both;
  -webkit-touch-callout: none;
  touch-action: pan-y;
}
.msg-row {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 12px 12px 12px 14px;
  cursor: pointer;
  background-color: var(--surface);
  background-image: linear-gradient(var(--tint), var(--tint));
  transition: background-color 0.12s;
  will-change: transform;
}
.msg:hover { --tint: var(--hover); }
.msg.is-selected { --tint: var(--selected); }
.msg.is-focused .msg-row { box-shadow: inset 0 0 0 1.5px var(--accent-soft); border-radius: 12px; }
.msg.is-checked { --tint: var(--accent-softer); }
.msg.is-collapsing { height: 0 !important; opacity: 0; transition: height 0.24s var(--ease), opacity 0.2s; }
/* revealed behind a row while swiping */
.swipe-bg {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 0 26px;
  color: #fff;
  font-weight: 650;
  font-size: 14px;
  background: var(--text-3);
  transition: background 0.18s;
}
.msg.is-swiping .swipe-bg { display: flex; }
.msg[data-side="end"] .swipe-bg { justify-content: flex-end; }
.msg[data-side="end"] .swipe-icon { order: 2; }
.msg.is-armed[data-tone="archive"] .swipe-bg { background: var(--success); }
.msg.is-armed[data-tone="inbox"] .swipe-bg { background: var(--accent); }
.msg.is-armed[data-tone="delete"] .swipe-bg { background: var(--danger); }
.msg.is-armed[data-tone="read"] .swipe-bg { background: var(--accent); }
.swipe-icon { width: 22px; height: 22px; transition: transform 0.2s var(--ease); }
.msg.is-armed .swipe-icon { transform: scale(1.18); }
.msg.is-unread .msg-row::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border-radius: 50%;
  background: var(--unread);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.msg-avatar { position: relative; width: 38px; height: 38px; align-self: start; }
.msg-check {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  opacity: 0;
  transition: opacity 0.12s;
  color: transparent;
}
.msg-check .icon { width: 16px; height: 16px; stroke-width: 3; }
.msg:hover .msg-check, .has-checked .msg-check { opacity: 1; color: var(--text-3); }
.msg.is-checked .msg-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.msg-body { min-width: 0; display: grid; gap: 2px; }
.msg-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.msg-from { font-size: 14px; font-weight: 500; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg.is-unread .msg-from { color: var(--text); font-weight: 650; }
.msg-thread-count { font-size: 11.5px; font-weight: 600; color: var(--text-3); background: var(--surface-3); padding: 0 6px; border-radius: 6px; flex: none; }
.msg-date { margin-left: auto; font-size: 12px; color: var(--text-3); white-space: nowrap; flex: none; font-variant-numeric: tabular-nums; }
.msg.is-unread .msg-date { color: var(--accent-text); font-weight: 600; }
.msg-subject { font-size: 13.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg.is-unread .msg-subject { color: var(--text); font-weight: 600; }
.msg-snippet { font-size: 13px; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
.msg-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.msg-meta:empty { display: none; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 550; background: var(--surface-3); color: var(--text-2); }
.tag .icon { width: 12px; height: 12px; }
.tag-accent { background: var(--accent-soft); color: var(--accent-text); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }
.tag-success { background: var(--success-soft); color: var(--success); }
.msg-star { color: var(--star); }
.msg-star .icon { width: 14px; height: 14px; fill: var(--star); stroke: var(--star); }
.msg-actions {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
}
.msg-actions .icon-btn { width: 30px; height: 30px; }
.msg-actions .icon-btn .icon { width: 17px; height: 17px; }
.msg:hover .msg-actions { opacity: 1; pointer-events: auto; }
.msg-actions .is-starred .icon { fill: var(--star); stroke: var(--star); }

.list-footer { padding: 12px 16px 24px; text-align: center; color: var(--text-3); font-size: 12.5px; }
.skeleton { display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding: 14px; }
.sk { background: linear-gradient(90deg, var(--surface-3) 0%, var(--hover) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes fade { from { opacity: 0; } }

.empty { display: grid; place-items: center; text-align: center; gap: 10px; padding: 56px 24px; color: var(--text-3); }
.empty-art { width: 120px; height: 120px; margin-bottom: 4px; }
.empty h3 { margin: 0; color: var(--text); font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.empty p { margin: 0; max-width: 280px; }

/* ============================================================
   Reader
   ============================================================ */
.reader {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  margin: 10px 10px 10px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
}
.reader::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 1px; background: var(--border); }
.reader-toolbar { display: flex; align-items: center; gap: 2px; padding: 12px 16px; border-bottom: 1px solid var(--border); min-height: 59px; }
.toolbar-sep { width: 1px; height: 20px; background: var(--border); margin: 0 6px; }
.reader-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.reader-inner { max-width: 860px; margin: 0 auto; padding: 28px 32px 48px; }
.thread-subject { font-size: 26px; line-height: 1.25; letter-spacing: -0.025em; font-weight: 650; margin: 0 0 6px; overflow-wrap: anywhere; }
.thread-sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--text-3); font-size: 13px; margin-bottom: 22px; }

.summary-card {
  position: relative;
  margin: 0 0 22px;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--gradient) border-box;
  border: 1.5px solid transparent;
  animation: rise 0.35s var(--ease);
}
.summary-card h4 { margin: 0 0 8px; display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 650; }
.summary-card h4 .icon { color: var(--accent); }
.summary-card p { margin: 0; white-space: pre-wrap; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }

.thread { display: grid; gap: 12px; }
.mail {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.mail.is-expanded { box-shadow: var(--shadow-md); }
.mail-head { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; cursor: pointer; }
.mail.is-expanded .mail-head { padding-bottom: 6px; }
.mail-who { min-width: 0; flex: 1; display: grid; gap: 1px; }
.mail-name-row { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.mail-name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-email { color: var(--text-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-to { color: var(--text-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-snippet { color: var(--text-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-date { color: var(--text-3); font-size: 12.5px; white-space: nowrap; display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.mail-date .d-short { display: none; }
.mail-tools { display: flex; gap: 2px; margin: -6px -8px 0 0; }
.mail-body { padding: 4px 18px 18px 68px; }
.mail-frame { width: 100%; border: 0; display: block; min-height: 40px; background: #fff; border-radius: 10px; }
.mail-frame-wrap { border-radius: 10px; overflow: hidden; }
.mail-frame-wrap.is-html { box-shadow: 0 0 0 1px var(--border); }
.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.65; }
.mail-text .quote { color: var(--text-3); border-left: 2px solid var(--border-strong); padding-left: 12px; margin: 6px 0; }
.quote-toggle {
  margin-top: 10px;
  height: 22px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text-2);
  display: inline-grid;
  place-items: center;
}
.quote-toggle .icon { width: 16px; height: 16px; }
.images-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-strong); color: var(--text-2); font-size: 12.5px; }
.images-banner .btn { margin-left: auto; }
.mail-status { display: flex; align-items: center; gap: 8px; margin: 0 18px 14px 68px; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.mail-status.is-failed { background: var(--danger-soft); color: var(--danger); }
.mail-status.is-queued { background: var(--accent-soft); color: var(--accent-text); }

.atts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-top: 16px; }
.att {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
  min-width: 0;
}
.att:hover { border-color: var(--border-strong); background: var(--hover); }
.att-thumb { width: 40px; height: 40px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-size: 10px; font-weight: 700; letter-spacing: 0.04em; overflow: hidden; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-meta { min-width: 0; display: grid; }
.att-name { font-weight: 550; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-size { font-size: 12px; color: var(--text-3); }
.att .icon { margin-left: auto; color: var(--text-3); }

.reply-bar { display: flex; gap: 8px; padding: 20px 0 0 0; flex-wrap: wrap; }
.reply-bar .btn { border: 1px solid var(--border); background: var(--surface); height: 40px; padding: 0 16px; border-radius: 12px; color: var(--text); }
.reply-bar .btn:hover { border-color: var(--border-strong); background: var(--hover); }

.reader-empty { flex: 1; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--text-3); }
.reader-empty h3 { margin: 18px 0 6px; font-size: 18px; letter-spacing: -0.015em; color: var(--text); font-weight: 650; }
.reader-empty p { margin: 0 0 18px; }
.reader-empty .hints { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; font-size: 12.5px; }
.reader-empty .hints span { display: inline-flex; gap: 6px; align-items: center; }
.envelope-art { width: 180px; height: auto; }

/* ============================================================
   Composer
   ============================================================ */
.composer-dock { position: fixed; right: 24px; bottom: 0; z-index: 40; display: flex; gap: 12px; align-items: flex-end; pointer-events: none; }
.composer {
  pointer-events: auto;
  width: 560px;
  max-width: calc(100vw - 32px);
  height: min(620px, calc(100dvh - 72px));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideUp 0.32s var(--ease);
}
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } }
.composer.is-min { height: 50px; }
.composer.is-min .composer-main, .composer.is-min .composer-foot { display: none; }
.composer.is-max {
  position: fixed;
  inset: 5vh 50% auto auto;
  transform: translateX(50%);
  width: min(920px, calc(100vw - 32px));
  height: 90vh;
  border-radius: 20px;
  border-bottom: 1px solid var(--border);
  animation: none;
}
.composer-backdrop { position: fixed; inset: 0; background: rgba(9, 10, 16, 0.4); backdrop-filter: blur(3px); pointer-events: auto; animation: fade 0.2s; }
.composer-head { display: flex; align-items: center; gap: 4px; padding: 0 8px 0 18px; height: 50px; flex: none; border-bottom: 1px solid var(--border); cursor: pointer; }
.composer-title { font-weight: 650; font-size: 14px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer-head .icon-btn { width: 30px; height: 30px; }
.composer-main { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.composer-main.is-dragging::after {
  content: "Drop files to attach";
  position: absolute;
  inset: 8px;
  display: grid;
  place-items: center;
  border: 2px dashed var(--accent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface));
  color: var(--accent-text);
  font-weight: 650;
  z-index: 3;
}
.c-row { display: flex; align-items: flex-start; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--border); min-height: 44px; }
.c-label { color: var(--text-3); font-size: 13px; width: 42px; flex: none; padding-top: 12px; }
.c-row select { border: 0; background: none; outline: 0; height: 44px; flex: 1; color: var(--text); }
.c-row > input { flex: 1; border: 0; outline: 0; background: none; height: 44px; min-width: 0; color: var(--text); }
.c-subject { font-weight: 600; font-size: 15px !important; }
.c-toggles { display: flex; gap: 2px; padding-top: 7px; }
.c-toggles button { height: 30px; padding: 0 8px; border-radius: 8px; color: var(--text-3); font-size: 13px; font-weight: 550; }
.c-toggles button:hover { background: var(--hover); color: var(--text); }
.recips { flex: 1; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding: 7px 0; position: relative; min-width: 0; cursor: text; }
.recips input { flex: 1; min-width: 120px; border: 0; outline: 0; background: none; height: 30px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 4px 0 4px;
  border-radius: 20px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  font-size: 13px;
  max-width: 100%;
}
.pill .avatar { width: 20px; height: 20px; font-size: 9.5px; }
.pill span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill button { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); }
.pill button:hover { background: var(--hover); color: var(--text); }
.pill button .icon { width: 12px; height: 12px; }
.pill.is-invalid { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.suggest {
  position: absolute;
  left: -8px;
  top: calc(100% + 4px);
  width: min(380px, calc(100vw - 48px));
  z-index: 10;
  padding: 6px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: rise 0.18s var(--ease);
}
.suggest button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 9px; text-align: left; }
.suggest button.is-active, .suggest button:hover { background: var(--accent-soft); }
.suggest .s-meta { display: grid; min-width: 0; }
.suggest .s-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest .s-email { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.c-toolbar { display: flex; align-items: center; gap: 1px; padding: 6px 12px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; flex: none; }
.c-toolbar .icon-btn { width: 30px; height: 30px; }
.c-toolbar .icon { width: 16px; height: 16px; }
.c-toolbar .icon-btn.is-on { background: var(--accent-soft); color: var(--accent-text); }
.editor {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  outline: 0;
  font-size: 14.5px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.editor:empty::before { content: attr(data-placeholder); color: var(--text-3); pointer-events: none; }
.editor p, .editor div { margin: 0; }
.editor blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.editor ul, .editor ol { margin: 6px 0; padding-left: 24px; }
.editor .courier-quote { color: var(--text-2); }
.editor .courier-quote * { color: inherit !important; background: transparent !important; font-family: inherit !important; }
.editor .courier-signature { color: var(--text-2); }
.c-atts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 10px; flex: none; }
.c-att {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 4px 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12.5px;
  max-width: 240px;
  position: relative;
  overflow: hidden;
}
.c-att .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; }
.c-att .size { color: var(--text-3); flex: none; }
.c-att .progress { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--gradient); transition: width 0.2s; }
.c-att button { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: var(--text-3); flex: none; }
.c-att button:hover { background: var(--hover); color: var(--text); }
.c-att .icon { width: 14px; height: 14px; }
.composer-foot { display: flex; align-items: center; gap: 6px; padding: 10px 12px 12px 14px; border-top: 1px solid var(--border); flex: none; }
.send-btn { height: 40px; padding: 0 18px; border-radius: 12px; }
.send-btn kbd { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.25); color: #fff; height: 18px; }
.save-state { font-size: 12px; color: var(--text-3); margin-left: auto; margin-right: 4px; white-space: nowrap; }
.ai-btn { color: var(--accent-text); }
.ai-btn:hover { background: var(--accent-soft); color: var(--accent-text); }
.ai-panel {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 8px;
  z-index: 5;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface);
  border: 1.5px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--gradient) border-box;
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 10px;
  animation: rise 0.22s var(--ease);
}
.ai-panel .ai-row { display: flex; gap: 8px; }
.ai-panel input { flex: 1; min-width: 0; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); padding: 0 12px; outline: 0; }
.ai-panel input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-chips .chip { height: 28px; }
.ai-chips .chip:hover { border-color: var(--accent); color: var(--accent-text); }
.ai-title { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 13px; }
.ai-title .icon { color: var(--accent); }
.ai-title .icon-btn { margin-left: auto; width: 28px; height: 28px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Popovers, menus, toasts, modals
   ============================================================ */
.menu {
  position: fixed;
  z-index: 70;
  min-width: 200px;
  padding: 6px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: rise 0.16s var(--ease);
}
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 9px; font-size: 13.5px; text-align: left; color: var(--text); }
.menu button:hover { background: var(--hover); }
.menu button .icon { color: var(--text-3); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 4px; }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 10px 10px 10px 16px;
  border-radius: 14px;
  background: #171a26;
  color: #f2f3f9;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: toastIn 0.3s var(--ease);
}
.toast.is-leaving { animation: toastOut 0.22s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(0.97); } }
.toast .icon { color: #a9a2ff; }
.toast.is-error .icon { color: #ff7b80; }
.toast.is-success .icon { color: #3dd68c; }
.toast-text { flex: 1; font-size: 13.5px; display: grid; }
.toast-text small { color: #9aa0b8; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.toast-action { height: 30px; padding: 0 12px; border-radius: 9px; font-weight: 650; font-size: 13px; color: #b9b3ff; }
.toast-action:hover { background: rgba(255, 255, 255, 0.08); }
.toast-close { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: #9aa0b8; }
.toast-close:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.toast-close .icon { width: 15px; height: 15px; }
.toast-progress { position: absolute; left: 0; bottom: 0; height: 2.5px; background: var(--gradient); transform-origin: left; animation: shrink linear forwards; width: 100%; }
@keyframes shrink { to { transform: scaleX(0); } }

.modal-root:empty { display: none; }
.modal-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(9, 10, 16, 0.45); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fade 0.2s; }
.modal {
  width: min(560px, 100%);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  outline: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  animation: rise 0.28s var(--ease);
}
.modal-wide { width: min(720px, 100%); }
.modal-head { position: relative; display: flex; align-items: center; gap: 10px; padding: 20px 20px 4px 24px; flex: none; }
.grabber { display: none; }
.modal-head h3 { margin: 0; font-size: 18px; letter-spacing: -0.015em; font-weight: 650; flex: 1; }
.modal-body { padding: 12px 24px 8px; display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; align-content: start; gap: 18px; overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 20px; flex: none; }
/* Grid tracks default to their widest child; keep everything inside the sheet's width. */
.field, .tab-panel, [data-domains], .domain-list, .domain-card, .domain-forward, .identity-list, .settings-section { grid-template-columns: minmax(0, 1fr); }
.modal-body > *, .tab-panel > *, .domain-card > * { min-width: 0; }
.setting-row { display: flex; align-items: center; gap: 16px; }
.setting-row .setting-text { flex: 1; display: grid; gap: 2px; }
.setting-row .setting-text strong { font-weight: 600; font-size: 13.5px; }
.setting-row .setting-text span { font-size: 12.5px; color: var(--text-3); }
.identity-list { display: grid; gap: 6px; }
.identity { display: flex; gap: 8px; align-items: center; }
.identity .input { height: 38px; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.range-row output { width: 36px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.settings-section { display: grid; gap: 14px; padding-top: 4px; }
.settings-section + .settings-section { border-top: 1px solid var(--border); padding-top: 18px; }
.settings-section h4 { margin: 0; font-size: 11.5px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }

.shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; }
.shortcut { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.shortcut span:last-child { display: flex; gap: 4px; }

/* ============================================================
   Settings: tabs, domains, install
   ============================================================ */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 4px;
  border-radius: 12px;
  background: var(--surface-3);
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: 0;
  z-index: 2;
}
.tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-2);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tab-panel { display: grid; gap: 18px; animation: fade 0.2s var(--ease); }
[data-domains] { display: grid; gap: 14px; }
@media (min-width: 821px) { .tab-panel { min-height: 340px; align-content: start; } }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-gap .input { flex: 1 1 140px; min-width: 0; height: 36px; }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--accent-softer); border: 1px solid var(--accent-soft); color: var(--text-2); font-size: 13px; line-height: 1.55; }
.callout .icon { color: var(--accent); margin-top: 2px; }
.callout-ok { background: var(--success-soft); border-color: transparent; align-items: center; }
.callout-ok .icon { color: var(--success); margin-top: 0; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checks li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13.5px; }
.checks li.is-ok .icon { color: var(--success); }
.checks li.is-bad .icon { color: var(--danger); }
.mx-host { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.checks small { flex-basis: 100%; color: var(--text-3); padding-left: 25px; }
.callout-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.callout code, .steps code, .field-hint code { font-size: 12px; padding: 1px 5px; border-radius: 5px; background: var(--surface-3); }
.domain-list { display: grid; gap: 10px; }
.domain-card { display: grid; gap: 12px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2); }
.domain-head { display: flex; align-items: center; gap: 10px; }
.domain-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.domain-name { font-size: 15px; letter-spacing: -0.01em; }
.domain-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.domain-forward { display: grid; gap: 6px; }
.domain-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.add-domain { padding-top: 6px; border-top: 1px solid var(--border); }
.tag-warn { background: rgba(212, 136, 6, 0.12); color: var(--warn); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 14px; color: var(--text-2); }
.steps b { color: var(--text); }
.steps pre { margin: 6px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-3); overflow-x: auto; }
.steps pre code { background: none; padding: 0; }
.install-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, var(--gradient) border-box; border: 1.5px solid transparent; }
.install-card .setting-text { flex: 1; display: grid; gap: 2px; }
.install-card .setting-text span { font-size: 12.5px; color: var(--text-3); }
.install-icon img { display: block; border-radius: 14px; box-shadow: 0 8px 20px -8px rgba(90, 76, 245, 0.6); }
.inline-icon { vertical-align: -3px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1280px) {
  :root { --list-w: 360px; --sidebar-w: 228px; }
}
@media (max-width: 1080px) {
  :root { --sidebar-w: 72px; }
  .sidebar { padding: 18px 10px 12px; align-items: center; }
  .sidebar-top { padding: 0; justify-items: center; }
  .brand-name, .btn-compose span, .btn-compose kbd, .nav-item span, .nav-section, .account-meta, .account > .icon, .live span, .app-version { display: none; }
  .btn-compose { width: 48px; height: 48px; padding: 0; justify-content: center; }
  .nav-item { width: 48px; justify-content: center; padding: 0; }
  .nav-count { position: absolute; top: 2px; right: 0; margin: 0; }
  .nav-count:not(.is-unread) { display: none; }
  .sidebar-bottom { justify-items: center; }
  .sidebar-tools { flex-direction: column; }
  .live { margin: 0 0 4px; padding: 0; }
  .account { padding: 6px; }
}
/* ============================================================
   Components used mostly on phones
   ============================================================ */
.offline-banner { display: flex; align-items: center; gap: 8px; margin: -2px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); font-size: 12.5px; font-weight: 550; }
.ptr {
  position: absolute;
  left: 50%;
  top: 8px;
  z-index: 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent-text);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translate(-50%, -48px);
  pointer-events: none;
}
.ptr.is-ready { color: var(--accent); }
.ptr.is-busy .icon { animation: spin 0.8s linear infinite; }
.list-scroll { position: relative; }
.install-row { display: none; }

.action-sheet { position: fixed; inset: 0; z-index: 95; display: flex; align-items: flex-end; background: rgba(9, 10, 16, 0.42); animation: fade 0.2s; }
.action-sheet.is-leaving { animation: fadeOut 0.2s forwards; }
.action-sheet.is-leaving .action-sheet-panel { animation: sheetDown 0.2s var(--ease) forwards; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes sheetDown { to { transform: translateY(100%); } }
.action-sheet-panel { width: 100%; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); display: grid; gap: 8px; animation: sheetUp 0.28s var(--ease); touch-action: none; }
.action-sheet-items { background: var(--surface); border-radius: 18px; overflow: hidden; padding: 6px; }
.action-sheet-title { text-align: center; color: var(--text-3); font-size: 13px; padding: 8px 16px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.action-sheet-items button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 50px; padding: 0 14px; border-radius: 12px; font-size: 16px; text-align: left; color: var(--text); }
.action-sheet-items button:active { background: var(--hover); }
.action-sheet-items button .icon { color: var(--text-2); width: 20px; height: 20px; }
.action-sheet-items button.is-danger, .action-sheet-items button.is-danger .icon { color: var(--danger); }
.action-sheet-items hr { border: 0; border-top: 1px solid var(--border); margin: 4px 8px; }
.action-sheet-cancel { width: 100%; min-height: 54px; border-radius: 18px; background: var(--surface); font-size: 16px; font-weight: 650; color: var(--accent-text); }
.menu button.is-danger, .menu button.is-danger .icon { color: var(--danger); }

.reader-bottombar { display: none; }
.hide-desktop { display: none !important; }
.c-mobile { display: none !important; }

/* No hover on touch screens: avoid "sticky" hover states and hide keyboard hints. */
@media (hover: none) {
  kbd, .search kbd, .btn-compose kbd, .send-btn kbd, .reader-empty .hints { display: none !important; }
  .msg:hover { --tint: transparent; }
  .msg.is-selected:hover { --tint: var(--selected); }
  .msg.is-checked:hover { --tint: var(--accent-softer); }
  .msg:hover .msg-actions { opacity: 0; pointer-events: none; }
  .msg:hover .msg-check { opacity: 0; }
  .has-checked .msg-check { opacity: 1 !important; }
  .msg:active { --tint: var(--hover); }
  .icon-btn:hover, .btn-ghost:hover, .nav-item:hover, .chip:hover { background: inherit; }
  .icon-btn:active, .btn-ghost:active, .nav-item:active { background: var(--hover); }
  .nav-item.is-active:hover { background: var(--surface); }
}

/* ============================================================
   Phones
   ============================================================ */
@media (max-width: 820px) {
  html, body { overscroll-behavior: none; }
  body { overflow: hidden; position: fixed; inset: 0; }
  .only-mobile { display: inline-grid !important; }
  .hide-mobile { display: none !important; }
  .hide-desktop { display: revert !important; }
  .app { grid-template-columns: 1fr; height: 100%; }

  /* 16px text stops iOS from zooming into fields */
  input, select, textarea, .editor, .input, .textarea, .select, .search input, .recips input, .c-row > input, .c-row select { font-size: 16px !important; }
  .icon-btn { width: 44px; height: 44px; border-radius: 12px; }
  .icon-btn .icon { width: 21px; height: 21px; }

  /* ---- drawer ---- */
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(304px, 84vw);
    z-index: 60;
    background: var(--bg);
    align-items: stretch;
    padding: calc(14px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
    transform: translateX(-100%);
    transition: transform 0.32s var(--ease), box-shadow 0.32s;
    box-shadow: none;
    border-radius: 0 22px 22px 0;
    will-change: transform;
  }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar-top { justify-items: stretch; padding: 0 6px; gap: 16px; }
  .brand-name, .btn-compose span, .nav-item span, .nav-section, .account-meta, .account > .icon, .live span, .app-version { display: initial; }
  .account-meta { display: grid !important; }
  .btn-compose { width: auto; height: 50px; padding: 0 18px; justify-content: flex-start; font-size: 15px; }
  .nav-item { width: auto; height: 48px; justify-content: flex-start; padding: 0 14px; font-size: 15px; gap: 14px; border-radius: 14px; }
  .nav-item .icon { width: 20px; height: 20px; }
  .nav-count { position: static; margin-left: auto; font-size: 13px; }
  .nav-count:not(.is-unread) { display: initial; }
  .sidebar-bottom { justify-items: stretch; }
  .sidebar-tools { flex-direction: row; }
  #shortcuts-btn { display: none; }
  .live { margin-right: auto; padding: 0 8px; }
  .install-row:not([hidden]) { display: flex; align-items: center; gap: 12px; margin: 4px 0; padding: 10px 12px; border-radius: 16px; text-align: left; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--gradient) border-box; border: 1.5px solid transparent; }
  .install-row img { border-radius: 10px; flex: none; }
  .install-row span { display: grid; }
  .install-row b { font-size: 14px; }
  .install-row small { font-size: 12px; color: var(--text-3); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(9, 10, 16, 0.42); opacity: 0; pointer-events: none; transition: opacity 0.32s; }
  .app.nav-open .scrim { opacity: 1; pointer-events: auto; }

  /* ---- list ---- */
  .list-pane, .reader { margin: 0; border-radius: 0; border: 0; height: 100%; box-shadow: none; }
  .list-header { padding: calc(6px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) 10px calc(12px + env(safe-area-inset-left)); gap: 10px; border-bottom-color: transparent; transition: border-color 0.2s; }
  .list-pane.is-scrolled .list-header { border-bottom-color: var(--border); }
  .list-title-row { min-height: 44px; gap: 4px; }
  #refresh-btn { display: none; }
  #list-more { margin-left: auto; }
  .list-title { font-size: 26px; letter-spacing: -0.03em; }
  .list-count { padding: 4px 0 0 4px; }
  .search { height: 44px; border-radius: 14px; padding: 0 12px; }
  .chips { margin: 0 -12px; padding: 0 12px; }
  .chip { height: 34px; padding: 0 14px; font-size: 13.5px; }
  .bulkbar { align-items: flex-start; padding: calc(6px + env(safe-area-inset-top)) 8px 0 4px; }
  .bulk-actions { gap: 0; }
  .bulkbar .icon-btn { width: 40px; }
  .bulkbar [data-bulk="star"] { display: none; }
  .message-list { padding: 4px 0 calc(96px + env(safe-area-inset-bottom)); gap: 0; }
  .msg { border-radius: 0; }
  .msg-row { padding: 13px calc(16px + env(safe-area-inset-right)) 13px calc(16px + env(safe-area-inset-left)); gap: 14px; }
  .msg + .msg .msg-row { box-shadow: inset 0 1px 0 var(--border); }
  .msg.is-focused .msg-row { box-shadow: none; }
  .msg.is-unread .msg-row::before { left: 5px; width: 6px; height: 6px; margin-top: -3px; }
  .msg-avatar, .msg-avatar .avatar { width: 44px; height: 44px; font-size: 15.5px; }
  .msg-from { font-size: 15.5px; }
  .msg-subject { font-size: 14.5px; }
  .msg-snippet { font-size: 14px; }
  .msg-date { font-size: 12.5px; }
  .msg-actions { display: none; }
  .list-footer { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .empty { padding-top: 72px; }

  .fab {
    position: fixed;
    right: calc(16px + env(safe-area-inset-right));
    bottom: calc(18px + env(safe-area-inset-bottom));
    height: 56px;
    min-width: 56px;
    padding: 0 20px 0 18px;
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    border-radius: 18px;
    color: #fff;
    font-weight: 650;
    font-size: 15px;
    background: var(--gradient);
    box-shadow: 0 14px 30px -10px rgba(90, 76, 245, 0.8);
    z-index: 20;
    transition: padding 0.25s var(--ease), transform 0.2s var(--ease), opacity 0.2s;
  }
  .fab:active { transform: scale(0.96); }
  .fab .icon { width: 22px; height: 22px; }
  .fab span { overflow: hidden; white-space: nowrap; max-width: 100px; transition: max-width 0.25s var(--ease), opacity 0.2s; }
  .fab.is-compact { padding: 0 17px; gap: 0; }
  .fab.is-compact span { max-width: 0; opacity: 0; }
  .app.has-checked-items .fab { transform: translateY(140%); opacity: 0; }

  /* ---- reader: full-screen page that slides in ---- */
  .reader { position: fixed; inset: 0; z-index: 30; transform: translateX(100%); transition: transform 0.34s var(--ease); will-change: transform; box-shadow: -10px 0 40px -20px rgba(0, 0, 0, 0.3); }
  .reader::before { display: none; }
  .app.reading .reader { transform: none; }
  .app.reading .list-pane { transform: translateX(-24%); transition: transform 0.34s var(--ease); }
  .list-pane { transition: transform 0.34s var(--ease); }
  .reader-toolbar { gap: 0; padding: calc(4px + env(safe-area-inset-top)) calc(6px + env(safe-area-inset-right)) 4px calc(4px + env(safe-area-inset-left)); min-height: 0; border-bottom-color: transparent; }
  .reader.is-scrolled .reader-toolbar { border-bottom-color: var(--border); }
  .reader-back { display: inline-flex !important; align-items: center; gap: 2px; height: 44px; padding: 0 10px 0 4px; border-radius: 12px; color: var(--accent-text); font-size: 16px; font-weight: 550; max-width: 46vw; }
  .reader-back span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .reader-back .icon { width: 24px; height: 24px; }
  .reader-toolbar .ai-btn span { display: none; }
  .reader-toolbar .ai-btn { width: 44px; height: 44px; padding: 0; border-radius: 12px; }
  .reader-toolbar .ai-btn .icon { width: 21px; height: 21px; }
  .reader-inner { padding: 8px calc(16px + env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left)); }
  .thread-subject { font-size: 23px; }
  .thread-sub { margin-bottom: 16px; }
  .thread { gap: 10px; }
  .mail { border-radius: 16px; }
  .mail-head { padding: 14px 12px 14px 14px; gap: 10px; }
  .mail-head .avatar-lg { width: 40px; height: 40px; }
  .mail-date .d-long { display: none; }
  .mail-date .d-short { display: inline; }
  .mail-email { display: none; }
  .mail-tools { margin: -10px -6px 0 0; }
  .mail-body { padding: 2px 12px 14px; }
  .mail-status { margin: 0 12px 12px; }
  .mail-text { font-size: 16px; }
  .atts { grid-template-columns: minmax(0, 1fr); }
  .reply-bar { display: none; }
  .reader-bottombar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    display: flex;
    justify-content: space-around;
    padding: 6px calc(8px + env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left));
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    border-top: 1px solid var(--border);
  }
  .reader-bottombar button { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 0 4px; border-radius: 12px; color: var(--text-2); font-size: 11px; font-weight: 550; }
  .reader-bottombar button:active { background: var(--hover); }
  .reader-bottombar .icon { width: 22px; height: 22px; }
  .reader-bottombar .is-primary { color: var(--accent-text); }

  /* ---- composer: full-screen, sized to the visible viewport so it sits above the keyboard ---- */
  .composer-dock { inset: 0; right: 0; }
  .composer, .composer.is-max {
    position: fixed;
    inset: auto 0 auto 0;
    top: var(--vv-top, 0px);
    width: 100%;
    max-width: none;
    height: var(--vv-height, 100%);
    border-radius: 0;
    border: 0;
    transform: none;
    animation: sheetUp 0.32s var(--ease);
  }
  .composer.is-min { inset: auto 0 0 0; top: auto; height: calc(56px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; }
  .composer-backdrop { display: none; }
  .composer-head { height: auto; min-height: 56px; padding: env(safe-area-inset-top) calc(8px + env(safe-area-inset-right)) 0 calc(4px + env(safe-area-inset-left)); gap: 2px; cursor: default; }
  .composer-head [data-act="min"], .composer-head [data-act="max"] { display: none; }
  .composer-head [data-act="close"] { order: -1; }
  .composer-title { font-size: 16px; display: grid; }
  .composer-title small { font-size: 11.5px; font-weight: 500; color: var(--text-3); }
  .c-mobile { display: inline-grid !important; }
  .c-send-mobile { display: inline-flex !important; height: 38px; padding: 0 14px; border-radius: 12px; gap: 6px; font-size: 15px; }
  .composer-foot { display: none; }
  .c-row { padding: 0 calc(16px + env(safe-area-inset-right)) 0 calc(16px + env(safe-area-inset-left)); min-height: 50px; }
  .c-label { width: 38px; padding-top: 14px; font-size: 15px; }
  .c-row > input, .c-row select { height: 50px; }
  .c-toggles { padding-top: 10px; }
  .c-toggles button { height: 32px; font-size: 14px; }
  .recips { padding: 9px 0; }
  .recips input { height: 32px; min-width: 90px; }
  .pill { height: 32px; font-size: 14px; }
  .pill button { width: 26px; height: 26px; }
  .editor { padding: 16px calc(16px + env(safe-area-inset-right)) 16px calc(16px + env(safe-area-inset-left)); font-size: 16px; }
  .c-toolbar { order: 10; border-top: 1px solid var(--border); border-bottom: 0; padding: 4px calc(6px + env(safe-area-inset-right)) calc(4px + var(--kb-safe, env(safe-area-inset-bottom))) calc(6px + env(safe-area-inset-left)); background: var(--surface); }
  .c-toolbar .icon-btn { width: 42px; height: 42px; }
  .c-toolbar .icon { width: 19px; height: 19px; }
  .c-atts { order: 9; padding: 6px 16px 10px; }
  .c-att { height: 38px; }
  .ai-panel { bottom: 58px; }
  .ai-panel .ai-row { flex-wrap: wrap; }
  .ai-panel input { height: 44px; flex-basis: 100%; }
  .ai-panel .ai-row .btn { flex: 1; height: 44px; }
  .suggest { position: fixed; left: 8px; right: 8px; width: auto; top: auto; margin-top: 4px; }
  .suggest button { min-height: 52px; }

  /* ---- sheets ---- */
  .modal-backdrop { padding: 0; align-items: end; padding-top: calc(env(safe-area-inset-top) + 12px); }
  .modal, .modal-wide { width: 100%; max-height: 100%; border-radius: 24px 24px 0 0; border-bottom: 0; animation: sheetUp 0.32s var(--ease); }
  .modal-head { padding: 22px 12px 4px 20px; touch-action: none; }
  .modal-tall { height: 100%; }
  .grabber { display: block; position: absolute; top: 8px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 5px; background: var(--border-strong); }
  .modal-body { padding: 10px 20px 16px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
  .modal-foot .btn { height: 46px; flex: 1; font-size: 15px; border-radius: 14px; }
  .modal-body:last-child { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .btn { height: 42px; font-size: 14.5px; }
  .btn-sm { height: 38px; font-size: 14px; padding: 0 14px; }
  .input, .select { min-height: 46px; border-radius: 12px; }
  .row-gap .input { height: 46px; }
  .switch { width: 50px; height: 30px; }
  .switch span::after { width: 24px; height: 24px; }
  .switch input:checked + span::after { transform: translateX(20px); }
  .tabs { top: -10px; }
  .tab { height: 40px; }
  .tab span { display: none; }
  .tab.is-active span { display: inline; }
  .identity { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .identity [data-id-name] { grid-column: 1 / -1; }
  .domain-head .icon-btn { margin-right: -8px; }
  .install-card { flex-wrap: wrap; }
  .install-card [data-install-action] { width: 100%; }
  .install-card [data-install-action] .btn { width: 100%; }
  .shortcuts { grid-template-columns: 1fr; }

  /* ---- toasts above the FAB / bottom bar ---- */
  .toasts { left: 12px; right: 12px; transform: none; bottom: calc(86px + env(safe-area-inset-bottom)); }
  .toast { min-width: 0; width: 100%; max-width: none; border-radius: 16px; padding: 12px 10px 12px 16px; }
  .toast-text { font-size: 14.5px; }
  .toast-action { height: 38px; font-size: 14.5px; }
  .toast-close { width: 36px; height: 36px; }
  .app:not(.reading) ~ .toasts { bottom: calc(88px + env(safe-area-inset-bottom)); }
}

/* Landscape phones: a tighter header */
@media (max-width: 820px) and (orientation: landscape) and (max-height: 500px) {
  .list-header { padding-top: 6px; }
  .list-title { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.domains-status { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 12.5px; min-height: 32px; }
.domains-status .btn { margin-left: auto; }
.domains-status .spinner { width: 14px; height: 14px; }
.c-send-mobile { display: none; }
