/* ==========================================================================
   Moe Mail — a quiet, warm mail client
   ========================================================================== */

:root {
  --sidebar: #11251e;
  --sidebar-2: #173229;
  --sidebar-ink: #dce7df;
  --sidebar-muted: #87a095;
  --sidebar-line: rgba(221, 235, 225, 0.11);
  --sidebar-active: #1d3d31;

  --paper: #f4f1e9;
  --paper-2: #ece8dc;
  --surface: #fffdf8;
  --surface-2: #f8f6ef;
  --ink: #18231d;
  --ink-soft: #34443a;
  --muted: #758077;
  --muted-2: #9da69e;
  --line: #e3ded1;
  --line-strong: #d4cebe;

  --accent: #146c55;
  --accent-deep: #0b4f3e;
  --accent-soft: #e1efe8;
  --accent-mist: #eef6f1;
  --amber: #d2953d;
  --amber-soft: #f7edda;
  --rose: #b95c52;
  --rose-soft: #f8e7e3;
  --blue: #4e7398;
  --violet: #77649a;

  --shadow-sm: 0 1px 2px rgba(26, 37, 30, 0.05), 0 2px 8px rgba(26, 37, 30, 0.035);
  --shadow-md: 0 10px 30px rgba(20, 34, 27, 0.09), 0 2px 8px rgba(20, 34, 27, 0.05);
  --shadow-lg: 0 30px 80px rgba(16, 29, 23, 0.2), 0 8px 24px rgba(16, 29, 23, 0.08);

  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --sidebar-w: 250px;
  --list-w: 386px;

  --font-ui: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Songti SC", "Noto Serif SC",
    ui-serif, Georgia, serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

button:disabled { cursor: not-allowed; opacity: 0.5; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

svg { display: block; flex: none; }

::selection { background: #cfe9dc; color: var(--accent-deep); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden { display: none !important; }

/* --------------------------------------------------------------------------
   Boot / no-script
   -------------------------------------------------------------------------- */

.boot-screen {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: var(--muted);
  background:
    radial-gradient(circle at 50% 35%, #fbfaf4 0%, var(--paper) 55%, #ebe7dc 100%);
}

.boot-mark {
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--sidebar);
  box-shadow: var(--shadow-md);
  animation: breathe 1.8s ease-in-out infinite;
}

.boot-mark svg { width: 24px; height: 24px; fill: #e8c47f; }

.boot-screen p { margin: 0; font-size: 13px; letter-spacing: 0.02em; }

@keyframes breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.035); }
}

.noscript {
  position: fixed; inset: 0;
  display: grid; place-content: center;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
}

/* --------------------------------------------------------------------------
   App frame
   -------------------------------------------------------------------------- */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(320px, var(--list-w)) minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
  background: var(--paper);
}

.scrim {
  display: none;
  position: fixed; inset: 0;
  z-index: 40;
  background: rgba(12, 24, 18, 0.4);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 180ms ease;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */

.sidebar {
  position: relative;
  z-index: 50;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px 15px 16px;
  color: var(--sidebar-ink);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(80, 131, 107, 0.16) 0%, transparent 44%),
    linear-gradient(178deg, var(--sidebar) 0%, #0d1f19 100%);
  overflow: hidden;
}

.sidebar::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}

.sidebar > * { position: relative; z-index: 1; }

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 9px 22px;
  min-height: 50px;
}

.brand-mark {
  width: 37px; height: 37px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #214537, #163126);
  border: 1px solid rgba(235, 216, 168, 0.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 6px 20px rgba(0,0,0,0.18);
}

.brand-mark svg { width: 21px; height: 21px; fill: #e9c77f; filter: drop-shadow(0 0 8px rgba(233, 199, 127, .25)); }

.brand-copy { min-width: 0; }

.brand-name {
  display: block;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: #f2f6f2;
  line-height: 1.1;
}

.brand-sub {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
}

.compose-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 21px;
  border-radius: 12px;
  background: #f0ead9;
  color: #173228;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,.6);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.compose-btn:hover {
  background: #faf5e7;
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,.7);
}

.compose-btn:active { transform: translateY(0); }
.compose-btn svg { color: var(--accent-deep); }

.compose-btn kbd {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid rgba(23, 50, 40, 0.16);
  background: rgba(255,255,255,.34);
  color: #52665d;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
}

.side-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0 -7px;
  padding: 0 7px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(220,231,223,.16) transparent;
}

.side-scroll::-webkit-scrollbar { width: 4px; }
.side-scroll::-webkit-scrollbar-thumb { background: rgba(220,231,223,.16); border-radius: 4px; }

.nav-group + .nav-group { margin-top: 22px; }

.nav-group-title {
  margin: 0 0 7px;
  padding: 0 12px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 39px;
  padding: 0 12px;
  border-radius: 10px;
  color: #c8d7cc;
  font-size: 13.5px;
  font-weight: 480;
  text-align: left;
  transition: background 140ms ease, color 140ms ease;
}

.nav-item:hover { background: rgba(255,255,255,.055); color: #eff6ef; }

.nav-item.active {
  background: linear-gradient(90deg, rgba(104, 169, 138, 0.2), rgba(104, 169, 138, 0.07));
  color: #f3f8f3;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(154, 204, 178, 0.12);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 2.5px;
  border-radius: 0 3px 3px 0;
  background: #96d3b0;
  box-shadow: 0 0 9px rgba(150, 211, 176, .5);
}

.nav-icon {
  width: 19px; height: 19px;
  display: grid; place-items: center;
  color: #93ab9f;
  transition: color 140ms ease;
}

.nav-item:hover .nav-icon { color: #d2e3d7; }
.nav-item.active .nav-icon { color: #a3ddb9; }

.nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-count {
  min-width: 21px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  color: #b6c9bc;
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.nav-item.active .nav-count {
  background: rgba(151, 209, 175, .18);
  color: #c5efd5;
}

.nav-count.zero { visibility: hidden; }

.label-nav .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.label-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255,255,255,.035);
}

.side-bottom { padding-top: 14px; }

.storage-card {
  margin: 0 2px 14px;
  padding: 12px 13px 11px;
  border-radius: 12px;
  border: 1px solid var(--sidebar-line);
  background: rgba(255,255,255,.035);
}

.storage-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 10.5px;
  color: var(--sidebar-muted);
}

.storage-top strong {
  color: #c9d8ce;
  font-size: 10.5px;
  font-weight: 600;
}

.storage-bar {
  height: 3px;
  border-radius: 3px;
  background: rgba(255,255,255,.09);
  overflow: hidden;
}

.storage-fill {
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #67a98b, #a7d7b8);
}

.account-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  margin: 0 -2px;
  border-radius: 12px;
  transition: background 140ms ease;
}

.account-card:hover { background: rgba(255,255,255,.045); }

.account-avatar {
  position: relative;
  width: 34px; height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #d5b679, #b58742);
  color: #2d2413;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4);
}

.account-avatar .status-dot {
  position: absolute;
  right: -1px; bottom: 0px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #69c492;
  border: 2px solid #11251e;
}

.account-meta { min-width: 0; flex: 1; }

.account-name {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #e4ede6;
  line-height: 1.3;
}

.account-email {
  display: block;
  margin-top: 1px;
  font-size: 10.5px;
  color: var(--sidebar-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-actions { display: flex; gap: 2px; }

.account-actions .icon-btn {
  width: 28px; height: 28px;
  color: #8da498;
}

.account-actions .icon-btn:hover {
  background: rgba(255,255,255,.08);
  color: #e5eee7;
}

/* --------------------------------------------------------------------------
   Generic buttons
   -------------------------------------------------------------------------- */

.icon-btn {
  width: 34px; height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  color: var(--muted);
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.icon-btn:hover { background: rgba(24, 35, 29, 0.065); color: var(--ink); }
.icon-btn:active { transform: scale(.96); }
.icon-btn.active { color: var(--amber); }
.icon-btn.active:hover { color: var(--amber); background: var(--amber-soft); }

/* --------------------------------------------------------------------------
   Message list
   -------------------------------------------------------------------------- */

.list-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--paper);
  border-right: 1px solid var(--line-strong);
}

.list-head {
  flex: none;
  padding: 24px 21px 13px;
}

.list-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 35px;
}

.list-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.1;
  color: var(--ink);
}

.count-badge {
  align-self: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e6e1d4;
  color: #6e786f;
  font-size: 10.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.head-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1px;
}

.mobile-menu-btn { display: none; }

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  height: 39px;
  margin-top: 16px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 248, .66);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.search-box:focus-within {
  background: var(--surface);
  border-color: #b8d0c3;
  box-shadow: 0 0 0 3px rgba(20, 108, 85, .08);
}

.search-box > svg { color: #8a958d; flex: none; }

.search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 9px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: var(--ink);
}

.search-input::placeholder { color: #9da69e; }

.search-shortcut {
  flex: none;
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.5);
  color: #939d95;
  font-size: 9.5px;
  font-weight: 600;
}

.search-clear {
  flex: none;
  width: 21px; height: 21px;
  display: none;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: #e8e3d7;
}

.search-clear:hover { background: #ded8ca; color: var(--ink); }
.search-box.has-value .search-clear { display: grid; }
.search-box.has-value .search-shortcut { display: none; }

.filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  padding: 5px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #7d887f;
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: all 140ms ease;
}

.chip:hover { background: rgba(255,255,255,.55); color: var(--ink); }

.chip.active {
  background: var(--ink);
  color: #f5f4ee;
  border-color: var(--ink);
  box-shadow: 0 3px 8px rgba(24,35,29,.14);
}

.list-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1px 10px 24px;
  scrollbar-width: thin;
  scrollbar-color: #d2ccbf transparent;
}

.list-scroll::-webkit-scrollbar { width: 5px; }
.list-scroll::-webkit-scrollbar-thumb { background: #d2ccbf; border-radius: 5px; }

.date-separator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 5px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9aa39b;
}

.date-separator::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, var(--line), transparent);
}

.message-item {
  position: relative;
  display: flex;
  gap: 11px;
  margin-bottom: 2px;
  padding: 13px 12px 13px 13px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.message-item:hover { background: rgba(255, 253, 248, .75); }

.message-item.selected {
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(211, 206, 193, .8);
}

.message-item.selected::after {
  content: "";
  position: absolute;
  left: 0; top: 17px; bottom: 17px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.message-item.unread .sender,
.message-item.unread .subject {
  font-weight: 680;
  color: var(--ink);
}

.message-item.unread .snippet { color: #68746b; }

.message-avatar {
  width: 37px; height: 37px;
  flex: none;
  display: grid;
  place-items: center;
  margin-top: 1px;
  border-radius: 50%;
  color: #fffef9;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 1px 2px rgba(20,30,24,.1);
}

.avatar-a { background: linear-gradient(145deg, #6c86a6, #4e6685); }
.avatar-b { background: linear-gradient(145deg, #9d7557, #7b523b); }
.avatar-c { background: linear-gradient(145deg, #7c739b, #5d5680); }
.avatar-d { background: linear-gradient(145deg, #4f8b74, #356b57); }
.avatar-e { background: linear-gradient(145deg, #b3766d, #8d554d); }
.avatar-f { background: linear-gradient(145deg, #b18d45, #8d6b2b); }
.avatar-g { background: linear-gradient(145deg, #5f8b90, #416e73); }
.avatar-me { background: linear-gradient(145deg, #c3a46b, #9d7b3f); color: #2d2413; }

.message-main { min-width: 0; flex: 1; }

.message-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.sender {
  flex: 1;
  min-width: 0;
  color: #3c4a41;
  font-size: 12.8px;
  font-weight: 560;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.message-time {
  flex: none;
  color: #98a199;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.message-subject-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.subject {
  flex: 1;
  min-width: 0;
  color: #445147;
  font-size: 12.8px;
  font-weight: 520;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.star-btn {
  flex: none;
  width: 23px; height: 23px;
  display: grid;
  place-items: center;
  margin-right: -3px;
  border-radius: 6px;
  color: #c4c9c2;
  opacity: 0;
  transition: opacity 120ms ease, color 120ms ease, background 120ms ease;
}

.message-item:hover .star-btn,
.message-item.selected .star-btn,
.star-btn.starred { opacity: 1; }

.star-btn:hover { background: var(--amber-soft); color: var(--amber); }
.star-btn.starred { color: var(--amber); }
.star-btn.starred svg { fill: currentColor; }

.snippet {
  margin: 3px 0 0;
  color: #8b958d;
  font-size: 11.5px;
  line-height: 1.45;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.label-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.012em;
  vertical-align: 1px;
}

.label-pill.work { background: #e5eee9; color: #356b58; }
.label-pill.important { background: var(--amber-soft); color: #93631f; }
.label-pill.design { background: #eae6f1; color: #67558a; }
.label-pill.finance { background: #e4ebf2; color: #486a90; }

.row-hover-actions {
  position: absolute;
  right: 9px;
  top: 7px;
  display: flex;
  gap: 1px;
  padding: 2px;
  border-radius: 8px;
  background: rgba(255, 253, 248, .96);
  box-shadow: 0 2px 8px rgba(20,30,24,.1), inset 0 0 0 1px var(--line);
  opacity: 0;
  transform: translateY(-2px);
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}

.message-item:hover .row-hover-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.message-item:hover .message-time { opacity: 0; }

.row-hover-actions .icon-btn { width: 26px; height: 26px; border-radius: 6px; }

.attachment-flag {
  display: inline-grid;
  place-items: center;
  margin-left: 3px;
  color: #9aa39b;
  vertical-align: -2px;
}

.unread-dot {
  position: absolute;
  left: 4px;
  top: 23px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--paper);
}

.list-empty {
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 70px 20px;
  text-align: center;
  color: var(--muted);
}

.list-empty svg { color: #b3bbb3; }
.list-empty strong { color: var(--ink-soft); font-size: 13.5px; }
.list-empty span { font-size: 12px; color: var(--muted); }

/* --------------------------------------------------------------------------
   Reader
   -------------------------------------------------------------------------- */

.reader-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  border-left: 1px solid rgba(211, 206, 193, .35);
}

.reader-toolbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 3px;
  height: 57px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, .9);
  backdrop-filter: blur(10px);
  z-index: 2;
}

.toolbar-group { display: flex; align-items: center; gap: 2px; }
.toolbar-spacer { flex: 1; }

.toolbar-divider {
  width: 1px;
  height: 18px;
  margin: 0 7px;
  background: var(--line);
}

.mobile-back { display: none; }

.reader-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d8d2c5 transparent;
}

.reader-scroll::-webkit-scrollbar { width: 6px; }
.reader-scroll::-webkit-scrollbar-thumb { background: #d8d2c5; border-radius: 6px; }

.reader-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 34px 44px 36px;
}

.email-subject {
  margin: 0 0 21px;
  font-family: var(--font-display);
  font-size: clamp(25px, 2.1vw, 32px);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -0.018em;
  color: #1a2b21;
  overflow-wrap: anywhere;
}

.email-meta {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 19px;
}

.email-meta .message-avatar {
  width: 41px; height: 41px;
  font-size: 13px;
  margin-top: 1px;
}

.meta-text { min-width: 0; flex: 1; }

.from-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

.from-line strong { font-weight: 650; color: var(--ink); }
.from-line .from-address { color: #8b968e; font-size: 11.5px; }

.to-line {
  margin-top: 2px;
  font-size: 11.5px;
  color: #909a92;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.to-line button {
  color: #6e7a71;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: #c9d1ca;
}

.email-date {
  flex: none;
  padding-top: 2px;
  color: #909a92;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  line-height: 1.6;
}

.email-label-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: -7px 0 15px;
}

.email-label-row .label-pill { font-size: 10px; padding: 2px 7px; }

.email-divider {
  height: 1px;
  margin: 0 0 25px;
  background: linear-gradient(90deg, var(--line), rgba(227, 222, 209, .2));
}

.email-body-wrap { position: relative; }

.email-frame {
  display: block;
  width: 100%;
  min-height: 120px;
  border: 0;
  background: transparent;
  color-scheme: light;
}

.email-text-body {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--font-ui);
  font-size: 13.5px;
  line-height: 1.8;
  color: #3a473f;
}

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.attachment-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  max-width: 280px;
  padding: 9px 12px 9px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  transition: border-color 140ms ease, background 140ms ease;
}

.attachment-card:hover { border-color: #bdcfc4; background: #f4f1e8; }

.attachment-icon {
  width: 33px; height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #ece7db;
  color: #8a7651;
}

.attachment-info { min-width: 0; }
.attachment-name {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attachment-size { display: block; margin-top: 1px; font-size: 10px; color: var(--muted); }

.reply-dock {
  flex: none;
  padding: 12px 24px 20px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 253, 248, .72), var(--surface) 30%);
}

.reply-box {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 9px 9px 9px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.reply-box:focus-within {
  border-color: #b7cfc2;
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(20, 108, 85, .07);
}

.reply-box .message-avatar { width: 27px; height: 27px; font-size: 10px; }

.reply-input {
  flex: 1;
  min-height: 26px;
  max-height: 140px;
  padding: 4px 2px;
  border: 0;
  outline: 0;
  background: transparent;
  resize: none;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
}

.reply-input::placeholder { color: #969f97; }

.reply-send {
  width: 31px; height: 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--accent);
  color: #f7fbf8;
  transition: background 140ms ease, transform 140ms ease;
}

.reply-send:hover { background: var(--accent-deep); transform: translateY(-1px); }

/* Empty reader */

.reader-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 17px;
  padding: 40px;
  text-align: center;
  background:
    radial-gradient(55% 50% at 50% 36%, rgba(225, 239, 232, .55) 0%, transparent 100%);
}

.empty-art {
  position: relative;
  width: 126px; height: 126px;
  display: grid;
  place-items: center;
}

.empty-art::before {
  content: "";
  position: absolute; inset: 5px;
  border-radius: 50%;
  border: 1px dashed #d2d9d2;
  animation: spin 26s linear infinite;
}

.empty-art::after {
  content: "";
  position: absolute; inset: 25px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #fdfbf5, #ebe9dd);
  box-shadow: inset 0 1px 0 #fff, 0 9px 30px rgba(40, 60, 48, .09);
}

.empty-art svg { position: relative; z-index: 1; color: #82968a; }
.empty-art .spark { position: absolute; z-index: 2; top: 14px; right: 16px; color: #cda45c; }

@keyframes spin { to { transform: rotate(360deg); } }

.reader-empty h2 {
  margin: 4px 0 -3px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  color: var(--ink-soft);
}

.reader-empty p { margin: 0; max-width: 300px; color: var(--muted); font-size: 12.5px; line-height: 1.7; }

.empty-hints {
  display: flex;
  gap: 16px;
  margin-top: 4px;
  color: #98a29a;
  font-size: 10.5px;
}

.empty-hints kbd {
  padding: 1px 5px;
  border: 1px solid #d6d1c4;
  border-radius: 4px;
  background: #f1eee5;
  font-size: 9.5px;
  font-family: var(--font-ui);
}

/* --------------------------------------------------------------------------
   Compose
   -------------------------------------------------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(12, 24, 18, 0.32);
  backdrop-filter: blur(3px);
  animation: overlay-in 160ms ease both;
}

@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.compose-card {
  display: flex;
  flex-direction: column;
  width: min(660px, 100%);
  height: min(700px, calc(100dvh - 40px));
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: compose-in 220ms cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes compose-in {
  from { opacity: 0; transform: translateY(15px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.compose-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: 0 14px 0 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fffdf8, #fbf9f3);
}

.compose-title {
  margin: 0;
  font-size: 13px;
  font-weight: 680;
  letter-spacing: .01em;
  color: var(--ink);
}

.compose-draft-state {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 4px;
  color: #9aa39b;
  font-size: 10.5px;
}

.compose-draft-state .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #b9c1b9;
}

.compose-head-actions { margin-left: auto; display: flex; gap: 1px; }

.compose-fields { flex: none; padding: 2px 22px 0; }

.compose-field {
  display: flex;
  align-items: center;
  min-height: 45px;
  border-bottom: 1px solid #eee9de;
}

.compose-field label {
  flex: none;
  width: 52px;
  color: #909a92;
  font-size: 12px;
}

.compose-field input {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: var(--ink);
}

.compose-field input::placeholder { color: #aab2aa; }

.compose-field .field-action {
  flex: none;
  padding: 3px 7px;
  border-radius: 5px;
  color: #8d978f;
  font-size: 10.5px;
}

.compose-field .field-action:hover { background: #f1eee5; color: var(--ink-soft); }

.compose-cc-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid #eee9de;
}

.compose-cc-row input {
  flex: 1;
  min-width: 0;
  border: 0; outline: 0;
  background: transparent;
  font-size: 12px;
  padding: 5px 0;
}

.compose-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 23px;
  outline: 0;
  font-size: 13.5px;
  line-height: 1.78;
  color: #37453c;
}

.compose-body:empty::before {
  content: attr(data-placeholder);
  color: #a7afa7;
  pointer-events: none;
}

.compose-body p { margin: 0 0 1em; }
.compose-body a { color: var(--accent); }

.compose-toolbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 8px 15px;
  border-top: 1px solid var(--line);
  background: #fbf9f3;
}

.compose-toolbar .icon-btn { width: 31px; height: 31px; }
.toolbar-mini-divider { width: 1px; height: 16px; margin: 0 5px; background: var(--line); }

.compose-foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.send-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 37px;
  padding: 0 17px;
  border-radius: 10px;
  background: var(--accent);
  color: #f8fcf9;
  font-size: 12.5px;
  font-weight: 650;
  box-shadow: 0 5px 14px rgba(20, 108, 85, .22);
  transition: background 140ms ease, transform 140ms ease;
}

.send-btn:hover { background: var(--accent-deep); transform: translateY(-1px); }
.send-btn:active { transform: translateY(0); }

.send-caret {
  width: 28px; height: 37px;
  display: grid;
  place-items: center;
  margin-left: -8px;
  border-left: 1px solid rgba(255,255,255,.22);
  border-radius: 0 10px 10px 0;
  background: var(--accent);
  color: #e7f3ec;
}

.compose-foot .icon-btn { margin-left: auto; }
.compose-foot .foot-note { margin-left: auto; color: #a1a9a1; font-size: 10.5px; }

/* --------------------------------------------------------------------------
   Settings
   -------------------------------------------------------------------------- */

.modal-card {
  width: min(680px, 100%);
  max-height: min(760px, calc(100dvh - 40px));
  overflow-y: auto;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.7);
  animation: compose-in 220ms cubic-bezier(.2, .8, .2, 1) both;
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,253,248,.94);
  backdrop-filter: blur(10px);
}

.modal-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
}

.modal-head .icon-btn { margin-left: auto; }

.modal-body { padding: 8px 24px 26px; }

.settings-hero {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 16px 0 22px;
  padding: 15px;
  border: 1px solid #d9e7de;
  border-radius: 13px;
  background: linear-gradient(135deg, #f0f7f3, #fbfcf8);
}

.settings-hero .status-orb {
  width: 37px; height: 37px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dceee3;
  color: var(--accent);
}

.settings-hero strong { display: block; font-size: 12.5px; }
.settings-hero p { margin: 2px 0 0; font-size: 11px; color: var(--muted); line-height: 1.5; }

.settings-section { padding: 16px 0; border-bottom: 1px solid #eee9de; }
.settings-section:last-child { border-bottom: 0; }

.settings-section h3 {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 680;
  color: var(--ink-soft);
}

.settings-section > p { margin: 0 0 13px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 10.5px; font-weight: 650; color: #7f8b82; letter-spacing: .03em; }

.form-field input {
  height: 37px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: 0;
  background: #fbf9f3;
  font-size: 12px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.form-field input:focus {
  border-color: #a9c9b8;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(20,108,85,.07);
}

.settings-note {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f5f2e9;
  color: #777f76;
  font-size: 10.5px;
  line-height: 1.6;
}

.settings-note svg { flex: none; margin-top: 1px; color: #9a8355; }

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */

.login-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
  background: var(--paper);
}

.login-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px;
  color: #eef5ef;
  background:
    radial-gradient(100% 80% at 10% 0%, rgba(79, 139, 113, .34) 0%, transparent 47%),
    radial-gradient(70% 60% at 100% 100%, rgba(210, 149, 61, .18) 0%, transparent 60%),
    #11251e;
}

.login-brand::before {
  content: "";
  position: absolute;
  width: 360px; height: 360px;
  right: -100px; bottom: -130px;
  border-radius: 50%;
  border: 1px solid rgba(210, 235, 220, .15);
  box-shadow: 0 0 0 40px rgba(210, 235, 220, .04), 0 0 0 80px rgba(210, 235, 220, .025);
}

.login-brand .brand { padding: 0; }
.login-brand .brand-name { font-size: 22px; }

.login-quote {
  position: relative;
  max-width: 430px;
  margin: 40px 0;
}

.login-quote h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: -.02em;
  color: #f1f5ee;
}

.login-quote h1 em {
  font-style: normal;
  color: #d9bd84;
}

.login-quote p {
  max-width: 340px;
  margin: 22px 0 0;
  color: #a8bdb0;
  font-size: 13px;
  line-height: 1.8;
}

.login-foot {
  display: flex;
  gap: 18px;
  color: #7f978a;
  font-size: 10.5px;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 36px;
  background:
    radial-gradient(60% 55% at 55% 30%, #fbfaf4 0%, var(--paper) 65%, #ece8dd 100%);
}

.login-card { width: min(352px, 100%); }

.login-card .eyebrow {
  margin: 0 0 10px;
  color: #9a8355;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.login-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 31px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.login-card .lede { margin: 9px 0 28px; color: var(--muted); font-size: 12.5px; line-height: 1.65; }

.login-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 13px; }
.login-field label { color: #66746a; font-size: 11px; font-weight: 650; letter-spacing: .02em; }

.login-field input {
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(255,253,248,.8);
  outline: 0;
  font-size: 13px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.login-field input:focus {
  border-color: #9bc3ae;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(20,108,85,.08);
}

.login-submit {
  width: 100%;
  height: 44px;
  margin-top: 7px;
  border-radius: 9px;
  background: var(--accent);
  color: #f8fcf9;
  font-size: 13px;
  font-weight: 650;
  box-shadow: 0 8px 20px rgba(20,108,85,.2);
  transition: background 140ms ease, transform 140ms ease;
}

.login-submit:hover { background: var(--accent-deep); transform: translateY(-1px); }

.login-error {
  margin: 10px 0 0;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--rose-soft);
  color: #8f3d35;
  font-size: 11.5px;
}

.login-note {
  margin-top: 20px;
  color: #99a199;
  font-size: 10.5px;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 15px;
  border-radius: 10px;
  background: #1a2c22;
  color: #f0f5f1;
  font-size: 12px;
  box-shadow: 0 12px 35px rgba(14,25,20,.25);
  animation: toast-in 220ms cubic-bezier(.2,.8,.2,1) both;
}

.toast svg { color: #9fd4b4; }
.toast.error { background: #5a2a25; }
.toast.error svg { color: #f0b1a8; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1240px) {
  :root { --sidebar-w: 232px; --list-w: 358px; }
  .reader-inner { padding: 30px 32px 34px; }
  .compose-btn kbd { display: none; }
}

@media (max-width: 1080px) {
  :root { --sidebar-w: 82px; --list-w: 344px; }

  .sidebar { padding: 20px 12px 14px; align-items: stretch; }
  .brand { justify-content: center; padding: 2px 0 20px; }
  .brand-copy, .brand-sub, .nav-label, .nav-count, .nav-group-title,
  .storage-card, .account-meta { display: none; }
  .compose-btn { justify-content: center; padding: 12px 0; }
  .compose-btn span, .compose-btn kbd { display: none; }
  .compose-btn svg { width: 19px; height: 19px; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item.active::before { top: 9px; bottom: 9px; }
  .nav-icon { width: 22px; height: 22px; }
  .label-nav { display: none; }
  .label-nav + .nav-group { margin-top: 0; }
  .account-card { justify-content: center; padding: 8px 0; }
  .account-actions { display: none; }
  .reader-inner { padding: 28px 27px 32px; }
}

@media (max-width: 820px) {
  :root { --list-w: 100%; }

  .app { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }

  .reader-pane { display: none; border-left: 0; }
  .app.mobile-reading .list-pane { display: none; }
  .app.mobile-reading .reader-pane { display: flex; }

  .mobile-back { display: inline-grid; }
  .mobile-menu-btn { display: inline-grid; }
  .list-head { padding: 19px 16px 11px; }
  .list-title { font-size: 24px; }
  .search-shortcut { display: none; }
  .list-scroll { padding: 1px 7px 22px; }
  .reader-inner { padding: 24px 22px 30px; }
  .email-subject { font-size: 25px; }
  .reply-dock { padding: 10px 14px 15px; }
  .email-meta { gap: 10px; }
  .email-date { font-size: 10.5px; }

  .compose-card { width: 100%; height: calc(100dvh - 24px); border-radius: 16px; }
  .overlay { padding: 12px; align-items: flex-end; }
  .modal-card { max-height: calc(100dvh - 20px); border-radius: 16px; }
}

@media (max-width: 640px) {
  :root { --sidebar-w: 268px; }

  .app { grid-template-columns: minmax(0, 1fr); }

  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    padding: 22px 16px 16px;
    transform: translateX(-102%);
    transition: transform 220ms cubic-bezier(.2,.8,.2,1);
    box-shadow: 20px 0 60px rgba(5,15,10,.28);
  }

  .app.sidebar-open .sidebar { transform: translateX(0); }
  .app.sidebar-open .scrim { display: block; opacity: 1; }

  .sidebar .brand { justify-content: flex-start; padding-left: 8px; }
  .sidebar .brand-copy, .sidebar .brand-sub, .sidebar .nav-label,
  .sidebar .nav-count, .sidebar .nav-group-title, .sidebar .storage-card,
  .sidebar .account-meta { display: block; }
  .sidebar .nav-group-title { display: block; }
  .sidebar .compose-btn { justify-content: flex-start; padding: 12px 14px; }
  .sidebar .compose-btn span { display: inline; }
  .sidebar .compose-btn svg { width: 18px; height: 18px; }
  .sidebar .nav-item { justify-content: flex-start; padding: 0 12px; }
  .sidebar .nav-icon { width: 19px; height: 19px; }
  .sidebar .account-card { justify-content: flex-start; padding: 9px 8px; }
  .sidebar .account-actions { display: flex; }
  .sidebar .label-nav { display: block; }
  .sidebar .label-nav + .nav-group { margin-top: 22px; }

  .list-head { padding: 16px 14px 10px; }
  .list-title { font-size: 23px; }
  .message-item { padding: 12px 10px 12px 12px; }
  .message-avatar { width: 35px; height: 35px; }
  .row-hover-actions { display: none; }
  .message-item:hover .message-time { opacity: 1; }
  .unread-dot { left: 2px; }

  .reader-toolbar { height: 52px; padding: 0 10px; }
  .reader-inner { padding: 21px 17px 26px; }
  .email-subject { font-size: 23px; margin-bottom: 17px; }
  .email-date { display: none; }
  .to-line { white-space: normal; }
  .compose-fields { padding: 2px 17px 0; }
  .compose-head { padding-left: 17px; }
  .compose-body { padding: 18px 18px; }
  .compose-toolbar { overflow-x: auto; }
  .compose-foot { padding: 11px 13px 14px; }
  .form-grid { grid-template-columns: 1fr; }

  .login-shell { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { padding: 26px 20px; }
  .login-card { width: min(360px, 100%); }
}

@media (max-width: 380px) {
  .filter-row { gap: 4px; }
  .chip { padding: 5px 9px; font-size: 11px; }
  .email-meta .message-avatar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   Small additions
   -------------------------------------------------------------------------- */

mark {
  background: #f2dfae;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

.spin { animation: spin .9s linear infinite; }

.compose-attachments {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 22px 9px;
}

.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 250px;
  padding: 4px 6px 4px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: #68756c;
  font-size: 10.5px;
}

.attach-chip > svg { color: #947e55; }
.attach-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip-size { color: #9ba39b; font-size: 9.5px; }

.attach-chip button {
  width: 16px; height: 16px;
  display: grid; place-items: center;
  border-radius: 4px;
  color: #939d95;
}
.attach-chip button:hover { background: #e9e4d8; color: var(--ink); }

.shortcut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  color: #68756c;
  font-size: 11.5px;
}

.shortcut-grid kbd {
  padding: 1px 5px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #f5f2e9;
  font-family: var(--font-ui);
  font-size: 10px;
}

.settings-section code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #f0ece2;
  font-size: 10.5px;
}

.field-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #7b867e;
  border-radius: 6px;
}

.field-action:hover { color: var(--ink); }

.form-field input[readonly] {
  color: #66736a;
  background: #f5f2e9;
  cursor: default;
}

@media (max-width: 640px) {
  .compose-attachments { padding: 0 17px 8px; }
  .shortcut-grid { grid-template-columns: 1fr; }
}

/* Login is a full page, not the three-column mail frame. */
.app.login-mode {
  display: block;
  height: 100dvh;
  overflow: auto;
}
