/* stary.mail design system — product register.
   "Midnight": deep midnight-navy and charcoal canvas, muted violet support,
   one electric-blue accent for primary action and unread signal, and a
   blue→violet gradient reserved for primary buttons and the brand mark. */

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

:root {
  color-scheme: dark;
  --bg: #0a0f1e;
  --panel: #0f1628;
  --panel-2: #131c31;
  --raised: #1a2540;
  --line: #24314f;
  --line-soft: #18233a;
  --txt: #e9edf8;
  --txt-dim: #b3bdd4;
  --muted: #7f8aa6;
  --faint: #55607c;
  --accent: #4c8dff;
  --accent-hover: #6ba1ff;
  --accent-soft: rgba(76, 141, 255, .15);
  --accent-ink: #071227;
  --violet: #7c6ce8;
  --violet-soft: rgba(124, 108, 232, .14);
  --grad: linear-gradient(135deg, #2f5fe0 0%, #6252cf 100%);
  --danger: #ef6b7f;
  --danger-soft: rgba(239, 107, 127, .13);
  --ok: #3fc38f;
  --ok-soft: rgba(63, 195, 143, .13);
  --info: #58a6e8;
  --shadow-1: 0 1px 2px rgba(3, 8, 20, .4);
  --shadow-2: 0 10px 30px rgba(3, 8, 20, .55);
  --shadow-3: 0 26px 70px rgba(3, 8, 20, .65);
  --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 999px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --t-fast: .13s cubic-bezier(.2,.7,.3,1);
  --t-med: .24s cubic-bezier(.2,.7,.3,1);
  --t-slow: .42s cubic-bezier(.16,.8,.3,1);
  --side-w: 232px;
  --list-w: 448px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-2: #f7f8fc;
  --raised: #eceff7;
  --line: #dde2ee;
  --line-soft: #e9ecf4;
  --txt: #161c2e;
  --txt-dim: #39415a;
  --muted: #667089;
  --faint: #97a0b5;
  --accent: #2f5fe0;
  --accent-hover: #244dc4;
  --accent-soft: rgba(47, 95, 224, .1);
  --accent-ink: #ffffff;
  --violet: #6252cf;
  --violet-soft: rgba(98, 82, 207, .1);
  --grad: linear-gradient(135deg, #2f5fe0 0%, #6252cf 100%);
  --danger: #c23a52;
  --danger-soft: rgba(194, 58, 82, .1);
  --ok: #18925f;
  --ok-soft: rgba(24, 146, 95, .1);
  --info: #2a6fc4;
  --shadow-1: 0 1px 2px rgba(22, 28, 46, .08);
  --shadow-2: 0 12px 32px rgba(22, 28, 46, .12);
  --shadow-3: 0 26px 70px rgba(22, 28, 46, .18);
}

html { -webkit-text-size-adjust: 100%; }
svg { width: 18px; height: 18px; flex: none; }
.btn svg { width: 15px; height: 15px; }
.user-chip .caret svg { width: 15px; height: 15px; }
.searchbox > svg { width: 16px; height: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font: 15px/1.5 var(--font);
  letter-spacing: .005em;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; }
button { font: inherit; color: inherit; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
::selection { background: var(--accent-soft); }
[hidden] { display: none !important; }

/* ============================== boot ============================== */
.boot {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.boot-mark {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--accent);
  animation: boot-pulse 1.1s ease-in-out infinite alternate;
}
@keyframes boot-pulse {
  from { transform: scale(.92); opacity: .55; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ============================== login ============================== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(760px 420px at 80% 6%, rgba(124,108,232,.13), transparent 68%),
    radial-gradient(560px 420px at 10% 92%, rgba(76,141,255,.11), transparent 70%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 412px;
  animation: rise-in var(--t-slow) both;
}
.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -.025em;
  margin-bottom: 26px;
}
.brand-mark { width: 22px; height: 22px; }
.login-brand .brand-mark { width: 30px; height: 30px; }
.brand-suffix { color: var(--muted); font-weight: 500; }
.login-surface {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 30px;
  box-shadow: var(--shadow-2);
}
.login-surface h1 { font-size: 19px; margin-bottom: 6px; }
.login-surface .sub { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; line-height: 1.6; }
.login-note {
  color: var(--faint);
  font-size: 12px;
  text-align: center;
  margin-top: 18px;
  line-height: 1.6;
}

/* ============================== form controls ============================== */
.field { margin-bottom: 16px; }
.field.compact { margin: 0 4px; }
.mt-12 { margin-top: 12px; }
.spacer { flex: 1; }
.strong { color: var(--txt); font-weight: 650; }
.note { color: var(--muted); font-size: 13.5px; line-height: 1.65; margin: 0 0 14px; }
.note.flush { margin: 0; font-size: 13px; }
.sub-head { font-size: 13.5px; margin: 0 0 8px; }
.link { color: var(--info); }
.link:hover { text-decoration: underline; }
.field > label {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 7px;
  letter-spacing: .02em;
}
.field .hint { font-size: 11.5px; color: var(--faint); margin-top: 5px; line-height: 1.5; }
.field .err { font-size: 12px; color: var(--danger); margin-top: 5px; }
.input, .field input:not([type="checkbox"]):not([type="radio"]), .field textarea, .field select {
  width: 100%;
  background: var(--panel-2);
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 13px;
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.field .sig-area { min-height: 120px; }
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
.input:focus, .field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input[type="file"] { padding: 9px 12px; font-size: 13px; color: var(--muted); }
.input-row { display: flex; gap: 8px; align-items: center; }
.input-row .input { flex: 1; }
.input-row.narrow { max-width: 280px; }
.input-suffix {
  display: inline-flex;
  align-items: center;
  flex: none;
  min-height: 41px;
  padding: 0 12px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--txt-dim);
  min-height: 44px;
}
.switch input { position: absolute; opacity: 0; }
.switch .track {
  width: 40px; height: 23px;
  flex: none;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--line);
  position: relative;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 17px; height: 17px;
  border-radius: 999px;
  background: var(--muted);
  transition: transform var(--t-med), background var(--t-fast);
}
.switch input:checked + .track { background: var(--accent-soft); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(17px); background: var(--accent); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================== buttons ============================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--r-sm);
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--txt-dim);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast),
              transform var(--t-fast), box-shadow var(--t-fast);
  min-height: 40px;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad); color: #fff; font-weight: 650; border: 0; }
.btn.primary:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(56, 96, 220, .35);
}
.btn.primary:active { transform: translateY(1px); filter: brightness(.98); }
.btn.ghost { border-color: var(--line); color: var(--txt-dim); }
.btn.ghost:hover { background: var(--raised); color: var(--txt); }
.btn.soft { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.btn.soft:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.btn.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.subtle:hover { background: var(--raised); color: var(--txt); }
.btn.sm { padding: 7px 14px; font-size: 12.5px; min-height: 34px; }
.btn.block { width: 100%; margin-top: 8px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy::after {
  content: "";
  position: absolute;
  width: 15px; height: 15px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  color: var(--accent-ink);
  animation: spin .7s linear infinite;
}
.btn.ghost.busy::after, .btn.danger.busy::after { color: var(--txt); }
@keyframes spin { to { transform: rotate(360deg); } }

.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  position: relative;
}
.iconbtn::before {
  content: "";
  position: absolute;
  inset: -5px;
}
.iconbtn:hover { background: var(--raised); color: var(--txt); }
.iconbtn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.iconbtn svg { width: 17px; height: 17px; }

/* ============================== app shell ============================== */
.app {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line-soft);
  padding: 18px 13px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.022em;
  padding: 2px 9px;
}
.side-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-right: 2px;
}
.side-actions { padding: 0 2px; }
.brand .domain-chip {
  margin-left: auto;
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.compose-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  background: var(--grad);
  color: #fff;
  border: 0;
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  transition: filter var(--t-fast), transform var(--t-fast), box-shadow var(--t-med);
  box-shadow: 0 6px 18px rgba(56, 96, 220, .3);
}
.compose-btn:hover { filter: brightness(1.07); box-shadow: 0 10px 26px rgba(56, 96, 220, .4); }
.compose-btn:active { transform: translateY(1px) scale(.99); }

.folder-group { display: flex; flex-direction: column; gap: 2px; }
.folder-group .group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 8px 11px 4px;
}
.group-label .label-btn { width: 26px; height: 26px; opacity: .7; }
.group-label .label-btn:hover { opacity: 1; }
.group-label .label-btn svg { width: 13px; height: 13px; }
.folder-row { display: flex; align-items: center; gap: 2px; }
.folder-row .folder { flex: 1; min-width: 0; }
.folder-row .folder-menu { flex: none; opacity: 0; width: 28px; height: 28px; }
.folder-row:hover .folder-menu, .folder-row .folder-menu:focus-visible { opacity: 1; }
.folder {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  color: var(--txt-dim);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background var(--t-fast), color var(--t-fast);
  min-height: 40px;
  position: relative;
}
.folder:hover { background: var(--raised); color: var(--txt); }
.folder.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.folder.on::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.folder .fico { width: 18px; height: 18px; flex: none; opacity: .85; }
.folder .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder .badge {
  margin-left: auto;
  min-width: 21px;
  text-align: center;
  background: var(--raised);
  color: var(--muted);
  border-radius: var(--r-pill);
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.folder.on .badge { background: var(--accent); color: var(--accent-ink); }

.side-foot {
  margin-top: auto;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 9px;
  border-radius: var(--r-sm);
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background var(--t-fast);
}
.user-chip:hover { background: var(--raised); }
.avatar {
  width: 33px; height: 33px;
  flex: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--raised);
  color: var(--txt-dim);
  border: 1px solid var(--line);
  text-transform: uppercase;
}
.avatar.accent { background: var(--grad); color: #fff; border-color: transparent; }
.user-chip .who { min-width: 0; flex: 1; }
.user-chip .who b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-chip .who span {
  display: block;
  font-size: 11px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-chip .caret { color: var(--faint); width: 15px; height: 15px; }

/* ============================== main + search ============================== */
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.searchbox {
  position: relative;
}
.searchbox svg {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  opacity: .55;
  pointer-events: none;
}
.searchbox input {
  width: 100%;
  background: var(--panel-2);
  color: var(--txt);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 9px 38px 9px 38px;
  font-size: 13px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.searchbox input:hover { border-color: var(--line); }
.searchbox input:focus {
  outline: none;
  background: var(--panel);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.searchbox .clear-search {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
}

/* ============================== mail view ============================== */
.mailview {
  display: grid;
  grid-template-columns: var(--list-w) 1fr;
  flex: 1;
  min-height: 0;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
}
.mailview .list-pane, .mailview .view-pane { min-height: 0; overflow-y: auto; }
.list-pane {
  border-right: 1px solid var(--line-soft);
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.view-pane { min-width: 0; background: var(--bg); overflow-y: auto; }

.list-head {
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.list-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}
.list-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.count-pill {
  font-size: 11px;
  color: var(--muted);
  background: var(--raised);
  border-radius: var(--r-pill);
  padding: 2px 9px;
  font-variant-numeric: tabular-nums;
}
.chip-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.chip {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  min-height: 30px;
}
.chip:hover { background: var(--raised); color: var(--txt-dim); }
.chip.on {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent);
}
.list-scroll { overflow-y: auto; flex: 1; }

/* bulk actions bar (replaces toolbar when selection active) */
.bulkbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel);
  animation: slide-down var(--t-med) both;
}
.bulkbar .n {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--accent);
  padding: 0 8px;
  font-variant-numeric: tabular-nums;
}
@keyframes slide-down {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================== message list ============================== */
.mlist { list-style: none; margin: 0; padding: 0; }
.mrow {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding: 11px 16px;
  cursor: pointer;
  transition: background var(--t-fast);
}
.mrow:hover { background: var(--panel); }
.mrow.sel { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--accent); }
.mrow .check {
  position: absolute;
  left: 7px; top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--t-fast);
  z-index: 2;
}
.mrow:hover .check, .mrow .check:focus-within, .mrow.has-check .check { opacity: 1; }
.mrow:hover .mavatar, .mrow.has-check .mavatar { opacity: .12; }
.mrow .check input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

.mavatar {
  width: 38px; height: 38px;
  flex: none;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: opacity var(--t-fast);
}
.mavatar.t0 { background: var(--accent-soft); color: var(--accent); }
.mavatar.t1 { background: var(--violet-soft); color: var(--violet); }
.mavatar.t2 { background: var(--raised); color: var(--txt-dim); }
.mavatar.big { width: 42px; height: 42px; border-radius: 13px; font-size: 15px; }

.mbody { min-width: 0; flex: 1; }
.mrow .l1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.mrow .udot {
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--accent);
  flex: none;
  transform: translateY(-1px);
}
.mrow .from {
  font-size: 13.5px;
  font-weight: 550;
  color: var(--txt-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
}
.mrow.unread .from { color: var(--txt); font-weight: 700; }
.att-ind {
  display: inline-flex;
  color: var(--faint);
  flex: none;
  transform: translateY(2px);
}
.att-ind svg { width: 13px; height: 13px; }
.mrow .date {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mrow.unread .date { color: var(--txt-dim); font-weight: 600; }
.mrow .l2 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  margin-top: 2px;
}
.mrow .subj {
  flex: 0 1 auto;
  flex-shrink: 0;
  max-width: 62%;
  font-size: 13px;
  font-weight: 550;
  color: var(--txt-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mrow.unread .subj { color: var(--txt); font-weight: 700; }
.mrow .snip {
  flex: 1 1 0;
  min-width: 0;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mrow .row-actions {
  display: flex;
  gap: 2px;
  flex: none;
  opacity: 0;
  transition: opacity var(--t-fast);
}
.mrow:hover .row-actions, .mrow .row-actions:focus-within { opacity: 1; }
.star-btn {
  width: 30px; height: 30px;
  border: 0;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  border-radius: var(--r-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--t-fast), transform var(--t-fast);
}
.star-btn:hover { color: #f2b544; transform: scale(1.12); }
.star-btn.on { color: #f2b544; }
.star-btn svg { width: 15px; height: 15px; }

.list-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.list-foot .foot-actions { display: flex; gap: 8px; }

.checkbox-all {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  padding: 4px;
}
.checkbox-all input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

/* ============================== reader ============================== */
.reader { max-width: 920px; padding: 26px 34px 80px; margin: 0 auto; }
.reader.animated { animation: reader-in .32s cubic-bezier(.2,.7,.3,1) both; }
@keyframes reader-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reader h1.subject {
  font-size: 23px;
  line-height: 1.28;
  letter-spacing: -.022em;
  margin-bottom: 16px;
  word-break: break-word;
}
/* ============================== reading workspace ============================== */
.reader-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 6px;
}
.reader-head .rh-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sender-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--line-soft);
}
.sender-card .who { min-width: 0; flex: 1; }
.sender-card .who-line {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sender-card .who-line b { color: var(--txt); font-weight: 650; font-size: 13.5px; }
.sender-card .who-line.sub { font-size: 12px; color: var(--faint); }
.sender-card .when { display: flex; align-items: center; gap: 4px; flex: none; }
.sender-card .when .date {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sender-card .iconbtn.on { color: var(--accent); }
.addr-chip {
  display: inline-block;
  background: var(--raised);
  border-radius: var(--r-pill);
  padding: 1px 9px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
  vertical-align: 1px;
}
.tool-sep { width: 1px; align-self: stretch; background: var(--line-soft); margin: 2px; }

.quick-reply {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
}
.quick-reply .mavatar.big { margin-top: 2px; }
.qr-box {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 12px 14px 10px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.qr-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.qr-box textarea {
  width: 100%;
  min-height: 56px;
  border: 0;
  background: transparent;
  color: var(--txt);
  font: 13.5px/1.6 var(--font);
  resize: vertical;
  outline: none;
}
.qr-box textarea::placeholder { color: var(--faint); }
.qr-actions { display: flex; gap: 8px; margin-top: 8px; }
.img-notice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.img-notice > span { flex: 1; min-width: 160px; }
.att-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 2px;
}
.att-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
}
.att-count svg { width: 13px; height: 13px; }
.att-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--r-sm);
  padding: 8px 13px;
  font-size: 12.5px;
  color: var(--txt-dim);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
  max-width: 280px;
}
.att-chip:hover { border-color: var(--accent); color: var(--txt); background: var(--raised); }
.att-chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-chip .sz { color: var(--faint); font-variant-numeric: tabular-nums; }
.att-chip svg { width: 15px; height: 15px; flex: none; opacity: .7; }

.body-frame {
  margin-top: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  overflow: hidden;
  background: #ffffff;
  box-shadow: var(--shadow-1);
}
.body-frame iframe {
  width: 100%;
  min-height: 140px;
  border: 0;
  display: block;
  background: #ffffff;
}
[data-theme="light"] .body-frame iframe { background: #ffffff; }
pre.body-text {
  margin: 18px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 22px;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.65;
  color: var(--txt-dim);
  max-width: 72ch;
}
.remote-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  padding: 9px 13px;
}

.reader-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 60vh;
  color: var(--muted);
  text-align: center;
  padding: 40px 30px;
}

/* ============================== empty / states ============================== */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
  padding: 72px 30px;
}
.empty .glyph, .reader-empty .glyph {
  width: 58px; height: 58px;
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  color: var(--faint);
}
.empty .glyph svg, .reader-empty .glyph svg { width: 26px; height: 26px; }
.empty h2, .reader-empty h2 { font-size: 16px; color: var(--txt-dim); }
.empty p, .reader-empty p { margin: 0; font-size: 13px; max-width: 38ch; line-height: 1.65; }
.empty .btn { margin-top: 12px; }

.skel {
  background: linear-gradient(90deg, var(--panel) 25%, var(--raised) 50%, var(--panel) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
  border-radius: var(--r-xs);
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-row {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  gap: 12px;
  align-items: center;
}
.skel-av { width: 38px; height: 38px; border-radius: 11px; flex: none; }
.skel-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skel-lines .skel:nth-child(1) { height: 12px; width: 38%; }
.skel-lines .skel:nth-child(2) { height: 11px; width: 72%; }

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent);
  color: var(--danger);
  padding: 12px 15px;
  border-radius: var(--r-sm);
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.55;
}
.alert svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.ok-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ok-soft);
  border: 1px solid color-mix(in srgb, var(--ok) 55%, transparent);
  color: var(--ok);
  padding: 12px 15px;
  border-radius: var(--r-sm);
  margin: 12px 0;
  font-size: 13px;
}

/* ============================== toasts ============================== */
.toast-stack {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 36px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: 13px 16px;
  font-size: 13px;
  color: var(--txt-dim);
  box-shadow: var(--shadow-2);
  animation: toast-in var(--t-med) both;
}
.toast.leaving { animation: toast-out .22s ease-in both; }
.toast.ok { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--danger); }
.toast svg { width: 17px; height: 17px; flex: none; }
.toast.ok svg { color: var(--ok); }
.toast.error svg { color: var(--danger); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  60%  { opacity: .9; transform: translateY(-2px) scale(1.01); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px) scale(.97); }
}

/* ============================== modal / dialog ============================== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 8, 15, .62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  animation: fade-in var(--t-med) both;
  overflow-y: auto;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  animation: modal-in var(--t-slow) both;
}
.modal.wide { max-width: 760px; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  60%  { transform: translateY(-3px) scale(1.005); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 22px 14px;
}
.modal-head h2 { font-size: 17px; }
.modal-head .close { margin-left: auto; }
.modal-body { padding: 4px 22px 20px; overflow-y: auto; }
.modal-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  padding: 15px 22px 20px;
  border-top: 1px solid var(--line-soft);
}
.modal-foot .left { margin-right: auto; }

/* ============================== compose ============================== */
.compose-modal { max-width: 720px; overflow: hidden; }
.compose-modal > .modal-head,
.compose-modal > .compose-field,
.compose-modal > .compose-extra,
.compose-modal > .editor-toolbar,
.compose-modal > .compose-atts,
.compose-modal > .modal-foot { flex: none; }
.compose-modal > .rte {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}
.compose-field {
  display: flex;
  align-items: baseline;
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
  padding: 8px 22px;
}
.compose-field label {
  width: 52px;
  flex: none;
  font-size: 12px;
  font-weight: 650;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.compose-field input, .compose-field select {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--txt);
  font-size: 14px;
  padding: 6px 0;
  font-family: inherit;
}
.compose-field input:focus, .compose-field select:focus { outline: none; }
.compose-field input::placeholder { color: var(--faint); }
.compose-extra { display: inline-flex; gap: 12px; margin-left: 62px; padding-bottom: 6px; }
.compose-extra button {
  border: 0; background: transparent;
  color: var(--faint); font-size: 11.5px;
  cursor: pointer; padding: 2px 0;
}
.compose-extra button:hover { color: var(--accent); }

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.editor-toolbar .sep { width: 1px; height: 18px; background: var(--line); margin: 0 6px; }
.editor-toolbar button {
  width: 32px; height: 32px;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast), color var(--t-fast);
}
.editor-toolbar button:hover { background: var(--raised); color: var(--txt); }
.editor-toolbar button.on { background: var(--accent-soft); color: var(--accent); }
.editor-toolbar svg { width: 16px; height: 16px; }
.editor-toolbar .fmt-b, .editor-toolbar .fmt-i, .editor-toolbar .fmt-u { font-size: 14px; }
.editor-toolbar .fmt-i { font-family: Georgia, serif; }

.rte {
  min-height: 240px;
  max-height: 46vh;
  overflow-y: auto;
  padding: 16px 22px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--txt);
  outline: none;
}
.rte:empty::before {
  content: attr(data-placeholder);
  color: var(--faint);
  pointer-events: none;
}
.rte blockquote {
  margin: 10px 0;
  padding: 4px 16px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}
.rte ul, .rte ol { padding-left: 26px; }
.rte a { color: var(--info); text-decoration: underline; }
.compose-atts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 22px 0;
}
.compose-att {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--raised);
  border-radius: var(--r-pill);
  padding: 6px 8px 6px 13px;
  font-size: 12px;
  color: var(--txt-dim);
  animation: rise-in var(--t-med) both;
}
.compose-att button {
  border: 0; background: transparent;
  color: var(--faint); cursor: pointer;
  display: inline-flex;
  border-radius: 999px;
  width: 20px; height: 20px;
  align-items: center; justify-content: center;
}
.compose-att button:hover { color: var(--danger); background: var(--danger-soft); }
.compose-att svg { width: 12px; height: 12px; }
.compose-att .sz { color: var(--faint); }

.dropzone-active .rte { outline: 2px dashed var(--accent); outline-offset: -6px; border-radius: var(--r-md); }

/* ============================== settings / admin ============================== */
.page {
  padding: 28px 34px 70px;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}
.page h1 { font-size: 24px; margin-bottom: 4px; }
.page .lead { color: var(--muted); font-size: 13.5px; margin: 0 0 26px; line-height: 1.6; }

.section {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  margin-bottom: 18px;
  overflow: hidden;
}
.section > h2 {
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 16px 20px 0;
}
.section .section-body { padding: 16px 20px 20px; }
.setting-rows { display: flex; flex-direction: column; padding: 6px 0 8px; }
.setting-row {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 13px 20px;
}
.setting-row.top { align-items: start; }
.setting-row + .setting-row { border-top: 1px solid var(--line-soft); }
.sr-desc b { display: block; font-size: 13px; font-weight: 650; color: var(--txt); }
.sr-desc span { display: block; font-size: 11.5px; color: var(--faint); line-height: 1.5; margin-top: 2px; }
.sr-ctrl { min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.sr-ctrl > .input, .sr-ctrl > select, .sr-ctrl > textarea { max-width: 340px; width: 100%; }
.stack-form { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 340px; }
.stack-form .field { margin: 0; }
.storage-meter { width: 100%; max-width: 340px; }
.kv-line { font-size: 13px; color: var(--txt-dim); margin-bottom: 8px; }
.section .section-note {
  font-size: 12px;
  color: var(--faint);
  padding: 0 20px 16px;
  line-height: 1.6;
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid3.stats { margin-bottom: 18px; }

.stat-card {
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 16px;
}
.stat-card .k { font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.stat-card .v { font-size: 21px; font-weight: 700; letter-spacing: -.015em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-card .s { font-size: 12px; color: var(--muted); margin-top: 2px; }

.quota-bar {
  height: 7px;
  background: var(--raised);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 9px;
}
.quota-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width var(--t-slow) ease-out;
}
.quota-bar i.hot { background: var(--danger); }
.quota-bar.narrow { width: 110px; }

/* tables */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th {
  text-align: left;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--txt-dim);
  vertical-align: middle;
}
table.data tbody tr { transition: background var(--t-fast); }
table.data tbody tr:hover { background: var(--panel-2); }
table.data td .email { color: var(--txt); font-weight: 560; }
table.data td .sub { font-size: 11.5px; color: var(--faint); }
table.data td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions-cell { display: flex; gap: 4px; justify-content: flex-end; }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--r-pill);
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 600;
}
.status-chip::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: currentColor;
}
.status-chip.active { background: var(--ok-soft); color: var(--ok); }
.status-chip.disabled { background: var(--danger-soft); color: var(--danger); }
.status-chip.role { background: var(--accent-soft); color: var(--accent); }

.filterbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  flex-wrap: wrap;
}
.filterbar .searchbox { max-width: 320px; }
.filterbar select {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--txt-dim);
  border-radius: var(--r-sm);
  padding: 9px 14px;
  font-size: 12.5px;
}

.create-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.create-bar .field { margin: 0; flex: 1 1 240px; min-width: 0; }
.create-bar .btn { margin-bottom: 1px; }

.contact-page .section { max-width: 680px; }
.ca-message { min-height: 180px; }
.contact-actions { display: flex; gap: 10px; }
.log-gate { display: flex; gap: 10px; align-items: flex-end; }
.log-gate .field { margin: 0; width: 100%; max-width: 320px; }
.privacy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px 16px;
  font-size: 12px;
  color: var(--faint);
}
.privacy-note svg { width: 14px; height: 14px; flex: none; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: 13px; }
.kv dt { color: var(--faint); font-size: 12px; padding-top: 1px; }
.kv dd { margin: 0; color: var(--txt-dim); word-break: break-word; }
.kv.shortcuts { grid-template-columns: 120px 1fr; align-items: center; gap: 10px 16px; }
.kv.shortcuts dt { padding-top: 0; }
kbd {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--raised);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt-dim);
  white-space: nowrap;
}

.log-list { display: flex; flex-direction: column; }
.log-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
}
.log-row:last-child { border-bottom: 0; }
.log-row .ts { color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.log-row .act { color: var(--accent); font-weight: 600; white-space: nowrap; }
.log-row .tgt { color: var(--txt-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-row .who { margin-left: auto; color: var(--faint); white-space: nowrap; }
.log-row .who.ok { color: var(--ok); }

/* menus */
.menu {
  position: absolute;
  z-index: 250;
  min-width: 200px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  padding: 6px;
  animation: menu-in var(--t-fast) both;
}
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-4px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.menu button, .menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--txt-dim);
  font-size: 13px;
  padding: 9px 11px;
  border-radius: var(--r-xs);
  cursor: pointer;
  text-align: left;
  min-height: 38px;
}
.menu button:hover, .menu a:hover { background: var(--raised); color: var(--txt); }
.menu button.danger { color: var(--danger); }
.menu button.danger:hover { background: var(--danger-soft); }
.menu .sep { height: 1px; background: var(--line-soft); margin: 5px 8px; }
.menu svg { width: 15px; height: 15px; opacity: .8; }

/* password reveal box (one-time generated password) */
.secret-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: .02em;
  word-break: break-all;
}
.secret-box .secret { flex: 1; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================== responsive ============================== */
.mobile-only { display: none; }

@media (max-width: 1100px) {
  :root { --list-w: 360px; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    z-index: 150;
    width: 280px;
    left: 0; top: 0; bottom: 0;
    height: 100dvh;
    transform: translateX(-102%);
    transition: transform var(--t-med);
    box-shadow: var(--shadow-3);
  }
  .sidebar.open { transform: translateX(0); }
  .side-scrim {
    position: fixed;
    inset: 0;
    z-index: 140;
    background: rgba(5,8,15,.5);
    animation: fade-in var(--t-med) both;
  }
  .mobile-only { display: inline-flex; }
  .mailview { grid-template-columns: 1fr; }
  .list-pane { border-right: 0; }
  body:not(.reading) .view-pane { display: none; }
  body.reading .list-pane { display: none; }
  .reader { padding: 18px 16px 64px; }
  .page { padding: 18px 16px 64px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .setting-row { grid-template-columns: 1fr; gap: 6px; }
  .compose-modal { max-width: none; height: 100%; max-height: 100%; border-radius: 0; }
  .overlay.compose-overlay { padding: 0; }
  .rte { max-height: none; flex: 1; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
}

@media (min-width: 901px) {
  .back-btn { display: none; }
}

@media (hover: none) {
  .mrow .check, .mrow .row-actions { opacity: 1; }
  .mrow:hover .mavatar, .mrow.has-check .mavatar { opacity: 1; }
  .folder-row .folder-menu { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
[data-motion="reduced"] *, [data-motion="reduced"] *::before, [data-motion="reduced"] *::after {
  animation-duration: .12s !important;
  transition-duration: .12s !important;
}
[data-motion="none"] *, [data-motion="none"] *::before, [data-motion="none"] *::after {
  animation: none !important;
  transition: none !important;
}
