/* ==========================================================================
   Core design system — shared by the admin console and the mailbox.
   Type: Hubot Sans (display), Mona Sans (UI), Fragment Mono (data).
   ========================================================================== */

@font-face {
  font-family: 'Mona Sans';
  src: url('../fonts/mona-sans.woff2') format('woff2');
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
}
@font-face {
  font-family: 'Hubot Sans';
  src: url('../fonts/hubot-sans.woff2') format('woff2');
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
}
@font-face {
  font-family: 'Fragment Mono';
  src: url('../fonts/fragment-mono.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  --f-ui: 'Mona Sans', 'Segoe UI', sans-serif;
  --f-display: 'Hubot Sans', 'Mona Sans', sans-serif;
  --f-mono: 'Fragment Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --r-xs: 4px;
  --r-sm: 7px;
  --r: 10px;
  --r-lg: 16px;
  --r-xl: 22px;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.83, 0, .17, 1);
  --ease-spring: linear(0, .006, .025 2.8%, .101 6.1%, .539 18.9%, .721 25.3%, .849 31.5%, .937 38.1%, .968 41.8%, .991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001);
  --t-fast: 160ms;
  --t: 280ms;

  /* Warm ink + bone, one vermilion signal. */
  color-scheme: dark;
  --bg: #0e0d0c;
  --bg-1: #141311;
  --bg-2: #1a1816;
  --bg-3: #221f1c;
  --bg-4: #2b2825;
  --line: rgba(255, 244, 230, .06);
  --line-2: rgba(255, 244, 230, .095);
  --line-3: rgba(255, 244, 230, .16);
  --ink: #f2ede6;
  --ink-2: #c9c0b4;
  --ink-3: #a1978b;
  --ink-4: #6e665d;
  --btn: #f2ede6;
  --btn-ink: #14110f;
  --btn-hover: #ffffff;
  --accent: #ff5b24;
  --accent-ink: #1a0b04;
  --accent-text: #ff7d4a;
  --accent-soft: rgba(255, 91, 36, .11);
  --accent-line: rgba(255, 91, 36, .36);
  --danger: #f2585c;
  --danger-soft: rgba(242, 88, 92, .12);
  --warn: #e3a64c;
  --warn-soft: rgba(227, 166, 76, .12);
  --ok: #6cc196;
  --ok-soft: rgba(108, 193, 150, .12);
  --info: #86a8d6;
  --info-soft: rgba(134, 168, 214, .12);
  --shadow-pop: 0 1px 0 rgba(255, 244, 230, .05) inset, 0 24px 60px -18px rgba(0, 0, 0, .75), 0 0 0 1px var(--line-2);
  --shadow-card: 0 1px 0 rgba(255, 244, 230, .035) inset;
  --scrim: rgba(8, 7, 6, .6);
  --plate: rgba(255, 244, 230, .028);
  --row-active: rgba(255, 244, 230, .06);
  --paper: #ffffff;
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f2eee8;
  --bg-1: #f8f5f0;
  --bg-2: #fcfaf7;
  --bg-3: #ffffff;
  --bg-4: #ebe5dc;
  --line: rgba(45, 30, 15, .07);
  --line-2: rgba(45, 30, 15, .11);
  --line-3: rgba(45, 30, 15, .2);
  --ink: #1b1714;
  --ink-2: #4a423b;
  --ink-3: #6b6259;
  --ink-4: #9b9389;
  --btn: #1b1714;
  --btn-ink: #f8f5f0;
  --btn-hover: #000000;
  --accent: #ef5019;
  --accent-ink: #ffffff;
  --accent-text: #c63f0e;
  --accent-soft: rgba(239, 80, 25, .09);
  --accent-line: rgba(239, 80, 25, .34);
  --danger: #cf3a3f;
  --danger-soft: rgba(207, 58, 63, .09);
  --warn: #a5680f;
  --warn-soft: rgba(165, 104, 15, .1);
  --ok: #2c8458;
  --ok-soft: rgba(44, 132, 88, .1);
  --info: #3b6aa8;
  --info-soft: rgba(59, 106, 168, .09);
  --shadow-pop: 0 24px 60px -20px rgba(60, 40, 20, .28), 0 0 0 1px var(--line-2);
  --shadow-card: 0 1px 2px rgba(60, 40, 20, .04);
  --scrim: rgba(40, 30, 20, .28);
  --plate: rgba(45, 30, 15, .028);
  --row-active: rgba(45, 30, 15, .055);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 450 14px/1.45 var(--f-ui);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11';
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
img, svg { display: block; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--accent-ink); }

* { scrollbar-width: thin; scrollbar-color: var(--line-3) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--line-3); background-clip: content-box; border: 3px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

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

.ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ico.fill { fill: currentColor; stroke: none; }

/* --- Type helpers ------------------------------------------------------ */
.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: -.01em; }
.label {
  font-family: var(--f-ui);
  font-size: 12px;
  font-weight: 580;
  letter-spacing: 0;
  color: var(--ink-3);
}
.display {
  font-family: var(--f-display);
  font-stretch: 112%;
  font-weight: 680;
  letter-spacing: -.02em;
  line-height: 1.05;
}
.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
.muted { color: var(--ink-3); font-weight: 500; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* --- Wordmark ---------------------------------------------------------- */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-family: var(--f-display);
  font-stretch: 118%;
  font-weight: 760;
  font-size: 17px;
  letter-spacing: -.035em;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
}
.wordmark i, .wordmark .wm-dot {
  font-style: normal;
  color: var(--accent);
  display: inline-block;
}
.wordmark small {
  margin-left: 10px;
  font-family: var(--f-ui);
  font-stretch: 100%;
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0;
  color: var(--ink-3);
  align-self: center;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
}
.wm-orb {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin-right: 9px;
  align-self: center;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* 3D wordmark ("PRIV MAILS"): extruded letters that turn once on the Y axis
   every few seconds and otherwise face front, so it stays readable. */
.wm3d {
  --cycle: 6.5s;
  display: inline-flex; align-items: center;
  perspective: 420px;
  font-family: var(--f-display); font-stretch: 118%; font-weight: 800;
  font-size: 15px; letter-spacing: .07em; line-height: 1;
  color: var(--ink);
  white-space: nowrap;
  user-select: none;
}
.wm3d-stage { display: inline-flex; transform-style: preserve-3d; animation: wm-spin var(--cycle) var(--ease-in-out) infinite; }
.wm3d-ch {
  position: relative; display: inline-block;
  transform-style: preserve-3d;
}
.wm3d-ch::before, .wm3d-ch::after {
  content: attr(data-c); position: absolute; inset: 0;
  pointer-events: none;
  /* Seen from behind mid-spin, only the plain (mirrored) letter shows. */
  backface-visibility: hidden;
}
/* Depth layers. Only transforms animate: opacity would flatten the 3D context. */
.wm3d-ch::before { color: var(--accent); transform: translateZ(-1.4px); }
.wm3d-ch::after { color: color-mix(in srgb, var(--accent) 50%, #000); transform: translateZ(-2.8px); }
.wm3d-sp { display: inline-block; width: .42em; }
.wm3d-ch { backface-visibility: visible; }
.wm3d-compact { font-size: 15px; letter-spacing: .02em; }
@keyframes wm-spin {
  0%, 62% { transform: rotateY(0deg); }
  86%, 100% { transform: rotateY(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .wm3d-stage { animation: none !important; transform: none !important; }
}

/* --- Buttons ----------------------------------------------------------- */
.btn {
  --_bg: var(--bg-3);
  --_fg: var(--ink);
  --_bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px; padding: 0 12px;
  border-radius: var(--r-sm);
  background: var(--_bg); color: var(--_fg);
  border: 1px solid var(--_bd);
  font-weight: 560; font-size: 13px; white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
  user-select: none;
  will-change: transform;
}
.btn:hover { --_bg: var(--bg-4); --_bd: var(--line-3); }
.btn:active { scale: .97; transition: scale 80ms; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn .ico { width: 15px; height: 15px; }
.btn-primary { --_bg: var(--btn); --_fg: var(--btn-ink); --_bd: transparent; font-weight: 640; }
.btn-primary:hover { --_bg: var(--btn-hover); --_bd: transparent; }
.btn-accent { --_bg: var(--accent); --_fg: var(--accent-ink); --_bd: transparent; font-weight: 640; }
.btn-accent:hover { --_bg: color-mix(in srgb, var(--accent) 88%, #fff); --_bd: transparent; }
.btn-ghost { --_bg: transparent; --_bd: transparent; color: var(--ink-2); }
.btn-ghost:hover { --_bg: var(--bg-3); --_bd: transparent; color: var(--ink); }
.btn-danger { --_fg: var(--danger); }
.btn-danger:hover { --_bg: var(--danger-soft); --_bd: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-danger-solid { --_bg: var(--danger); --_fg: #fff; --_bd: transparent; }
.btn-danger-solid:hover { --_bg: color-mix(in srgb, var(--danger) 88%, #fff); --_bd: transparent; }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; gap: 5px; border-radius: 5px; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 14px; border-radius: var(--r); }
.btn-block { width: 100%; }

.icon-btn {
  width: 32px; height: 32px;
  display: inline-grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  transition: background var(--t-fast), color var(--t-fast);
  position: relative;
  flex: none;
}
.icon-btn:hover { background: var(--bg-3); color: var(--ink); }
.icon-btn.active { color: var(--accent-text); }
.icon-btn:disabled { opacity: .35; pointer-events: none; }
.icon-btn-sm { width: 26px; height: 26px; border-radius: 5px; }
.icon-btn-sm .ico { width: 14px; height: 14px; }

.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite; opacity: .8; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Inputs ------------------------------------------------------------ */
.input, .select {
  height: 34px; width: 100%;
  padding: 0 11px;
  border-radius: var(--r-sm);
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  color: var(--ink);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.input::placeholder { color: var(--ink-4); }
.input:hover, .select:hover { border-color: var(--line-3); }
.input:focus, .select:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.mono { font-size: 12.5px; }
.select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.field { display: grid; gap: 6px; }
.field > .label { padding-left: 1px; }
.field-hint { font-size: 12px; color: var(--ink-3); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group > .ico { position: absolute; left: 10px; color: var(--ink-3); pointer-events: none; }
.input-group > .input { padding-left: 32px; }
.input-group > .input-suffix { position: absolute; right: 4px; }

.search-field { position: relative; display: flex; align-items: center; min-width: 0; }
.search-field > .ico { position: absolute; left: 10px; color: var(--ink-3); pointer-events: none; width: 15px; height: 15px; }
.search-field > .input { padding-left: 32px; padding-right: 54px; background: var(--bg-1); }
.search-field kbd { position: absolute; right: 8px; }
.search-field .search-clear { position: absolute; right: 4px; }

kbd, .kbd {
  font-family: var(--f-mono);
  font-size: 10.5px;
  min-width: 20px; height: 20px; padding: 0 5px;
  display: inline-grid; place-items: center;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  color: var(--ink-3);
  background: var(--bg-2);
  line-height: 1;
}

/* Checkbox */
.check {
  position: relative; width: 16px; height: 16px; flex: none;
  display: inline-grid; place-items: center;
}
.check input { position: absolute; inset: -4px; opacity: 0; margin: 0; cursor: pointer; }
.check span {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid var(--ink-4);
  transition: background var(--t-fast), border-color var(--t-fast);
  display: grid; place-items: center;
  pointer-events: none;
}
.check span::after {
  content: ''; width: 8px; height: 4.5px;
  border-left: 2px solid var(--btn-ink); border-bottom: 2px solid var(--btn-ink);
  transform: rotate(-45deg) translate(1px, -1px) scale(0);
  transition: transform var(--t-fast) var(--ease-spring);
}
.check input:checked + span { background: var(--btn); border-color: var(--btn); }
.check input:checked + span::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check input:indeterminate + span { background: var(--btn); border-color: var(--btn); }
.check input:indeterminate + span::after { border-left: 0; transform: none; width: 8px; height: 0; border-bottom-width: 2px; }
.check:hover span { border-color: var(--ink-3); }

/* Switch */
.switch { position: relative; width: 32px; height: 18px; flex: none; display: inline-block; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span {
  position: absolute; inset: 0; border-radius: 99px;
  background: var(--bg-4); border: 1px solid var(--line-2);
  transition: background var(--t);
}
.switch span::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--ink-2);
  transition: transform var(--t) var(--ease-spring), background var(--t);
}
.switch input:checked + span { background: var(--accent); border-color: transparent; }
.switch input:checked + span::after { transform: translateX(14px); background: #fff; }

/* Segmented control (thumb slides via motion.indicator) */
.seg {
  position: relative;
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--bg-1); border: 1px solid var(--line-2);
  border-radius: 9px;
  isolation: isolate;
}
.seg > .ind {
  position: absolute; left: 0; top: 0; z-index: -1;
  border-radius: 6px;
  background: var(--bg-4);
  box-shadow: 0 1px 0 rgba(255, 244, 230, .06) inset, 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .5s var(--ease-spring), width .5s var(--ease-spring), height .3s var(--ease), opacity .2s;
}
:root[data-theme='light'] .seg > .ind { background: var(--bg-3); box-shadow: 0 1px 3px rgba(60, 40, 20, .14), 0 0 0 1px var(--line); }
.seg button {
  height: 26px; padding: 0 11px; border-radius: 6px;
  font-size: 12.5px; font-weight: 560; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 6px;
  transition: color var(--t);
  white-space: nowrap;
}
.seg button:hover { color: var(--ink-2); }
.seg button.active { color: var(--ink); }
.seg .count { font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-3); }

/* Chips + badges */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px;
  border-radius: 99px;
  font-size: 11.5px; font-weight: 560;
  background: var(--bg-3); color: var(--ink-2);
  border: 1px solid var(--line-2);
  white-space: nowrap;
}
.chip .ico { width: 12px; height: 12px; }
.chip-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.chip-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip-accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--line-3); color: var(--ink); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.dot-live { position: relative; background: var(--ok); }
.dot-live::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid var(--ok); opacity: 0;
  animation: ping 2.2s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(.4); opacity: .9; } 80%, 100% { transform: scale(1.4); opacity: 0; } }

.badge {
  font-family: var(--f-mono);
  font-size: 10.5px;
  min-width: 20px; height: 18px; padding: 0 6px;
  border-radius: 99px;
  display: inline-grid; place-items: center;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.badge-accent { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
/* "+N" unread pill: louder than a plain count, and it pops when it grows. */
.badge-new.badge-accent { box-shadow: 0 0 0 3px var(--accent-soft), 0 2px 10px -2px var(--accent-line); }
.badge-new.bump { animation: badge-pop .7s var(--ease-spring); }
@keyframes badge-pop { 0% { transform: scale(.4); } }

/* Code-box */
.code-copy {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-1); border: 1px dashed var(--line-3);
  border-radius: var(--r-sm);
  padding: 6px 6px 6px 10px;
  font-family: var(--f-mono); font-size: 12px; color: var(--ink);
  min-width: 0;
}
.code-copy code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.code-copy code::-webkit-scrollbar { display: none; }

/* OTP chip (verification code detected in a message) */
.otp {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 5px 0 8px;
  border-radius: 99px;
  background: var(--accent-soft); color: var(--accent-text);
  border: 1px solid transparent;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em;
  cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast);
}
.otp:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.otp:active { scale: .95; }
.otp .ico { width: 12px; height: 12px; }

/* --- Avatars ----------------------------------------------------------- */
.av {
  --_s: 32px;
  width: var(--_s); height: var(--_s);
  border-radius: 9px;
  flex: none;
  position: relative;
  display: grid; place-items: center;
  font-family: var(--f-display); font-stretch: 110%;
  font-weight: 700; font-size: calc(var(--_s) * .4);
  color: rgba(255, 255, 255, .92);
  background: var(--_c, #3b3f47);
  overflow: hidden;
  user-select: none;
}
.av img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  padding: 22%;
  background: #fbf8f4;
  object-fit: contain;
}
.av-sm { --_s: 26px; border-radius: 7px; }
.av-lg { --_s: 42px; border-radius: 12px; }

/* --- Popovers / menus -------------------------------------------------- */
.menu {
  position: fixed; z-index: 90;
  min-width: 210px; max-width: 320px;
  padding: 5px;
  background: var(--bg-3);
  border-radius: var(--r);
  box-shadow: var(--shadow-pop);
  opacity: 0; transform: translateY(-4px) scale(.98);
  transform-origin: top left;
  transition: opacity var(--t-fast), transform var(--t-fast) var(--ease);
  pointer-events: none;
}
.menu.open { opacity: 1; transform: none; pointer-events: auto; transition: opacity .2s, transform .45s var(--ease-spring); }
.menu.open > * { animation: menu-in .4s var(--ease) backwards; }
.menu.open > :nth-child(2) { animation-delay: 15ms; } .menu.open > :nth-child(3) { animation-delay: 30ms; }
.menu.open > :nth-child(4) { animation-delay: 45ms; } .menu.open > :nth-child(5) { animation-delay: 60ms; }
.menu.open > :nth-child(6) { animation-delay: 75ms; } .menu.open > :nth-child(n+7) { animation-delay: 90ms; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.menu-item {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  height: 32px; padding: 0 10px;
  border-radius: 6px;
  font-size: 13px; color: var(--ink);
  text-align: left; white-space: nowrap;
}
.menu-item .ico { color: var(--ink-3); width: 15px; height: 15px; }
.menu-item:hover, .menu-item.hot { background: var(--bg-4); }
.menu-item:hover .ico { color: var(--ink); }
.menu-item .menu-meta { margin-left: auto; display: flex; gap: 3px; color: var(--ink-3); font-family: var(--f-mono); font-size: 11px; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger .ico { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-soft); }
.menu-sep { height: 1px; background: var(--line-2); margin: 5px 4px; }
.menu-head { padding: 8px 10px 4px; }

/* --- Tooltip ----------------------------------------------------------- */
.tip {
  position: fixed; z-index: 120; pointer-events: none;
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--ink); color: var(--bg);
  font-size: 11.5px; font-weight: 560;
  white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
  opacity: 0; transform: translateY(4px) scale(.96);
  transition: opacity 120ms, transform .35s var(--ease-spring);
}
.tip.show { opacity: 1; transform: none; }
.tip kbd { background: transparent; color: inherit; border-color: color-mix(in srgb, var(--bg) 35%, transparent); opacity: .75; height: 17px; min-width: 17px; font-size: 10px; }

/* --- Toasts ------------------------------------------------------------ */
.toasts {
  position: fixed; z-index: 130;
  left: 50%; bottom: 22px; transform: translateX(-50%);
  display: grid; gap: 8px; justify-items: center;
  pointer-events: none;
  width: min(520px, calc(100vw - 24px));
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  min-height: 42px; padding: 6px 6px 6px 14px;
  border-radius: var(--r);
  background: var(--bg-4); color: var(--ink);
  box-shadow: var(--shadow-pop);
  font-size: 13px; font-weight: 520;
  animation: toast-in .6s var(--ease-spring);
  max-width: 100%;
}
.toast .ico { color: var(--ink-3); }
.toast-ok .ico { color: var(--ok); }
.toast-err .ico { color: var(--danger); }
.toast-msg { flex: 1; min-width: 0; padding: 4px 0; }
.toast .btn { height: 28px; }
.toast.out { animation: toast-out .2s var(--ease) forwards; }
.toast:not(:has(.btn)) { padding-right: 16px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(18px) scale(.94); filter: blur(4px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px) scale(.97); } }

/* --- Modal ------------------------------------------------------------- */
.modal-root {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 16px;
  background: var(--scrim);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in .16s var(--ease);
}
.modal-root.out { animation: fade-out .14s var(--ease) forwards; }
.modal {
  width: min(460px, 100%);
  max-height: calc(100vh - 32px);
  display: flex; flex-direction: column;
  background: var(--bg-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  animation: modal-in .55s var(--ease-spring);
  overflow: hidden;
}
.modal-wide { width: min(640px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 4px; }
.modal-head h2 { margin: 0; font-family: var(--f-display); font-stretch: 110%; font-weight: 660; font-size: 18px; letter-spacing: -.01em; }
.modal-head p { margin: 4px 0 0; color: var(--ink-3); font-size: 13px; }
.modal-head .icon-btn { margin: -6px -8px 0 auto; }
.modal-body { padding: 16px 20px; display: grid; gap: 14px; overflow: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px 18px; border-top: 1px solid var(--line); background: var(--bg-1); }
.modal-foot .spacer { flex: 1; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.96); filter: blur(3px); } }
.modal-body > *, .modal-head > * { animation: menu-in .5s var(--ease) backwards; }
.modal-body > :nth-child(2) { animation-delay: 40ms; } .modal-body > :nth-child(3) { animation-delay: 80ms; } .modal-body > :nth-child(n+4) { animation-delay: 120ms; }

.form-error {
  display: flex; gap: 8px; align-items: flex-start;
  color: var(--danger); background: var(--danger-soft);
  border-radius: var(--r-sm);
  padding: 8px 10px; font-size: 12.5px;
}
.form-error:empty { display: none; }

/* --- Skeleton ---------------------------------------------------------- */
.sk {
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-3) 0%, var(--bg-4) 50%, var(--bg-3) 100%);
  background-size: 200% 100%;
  animation: sk 1.4s linear infinite;
}
@keyframes sk { to { background-position: -200% 0; } }

/* --- Empty states ------------------------------------------------------ */
.empty {
  display: grid; place-items: center; text-align: center;
  gap: 6px; padding: 48px 24px;
  color: var(--ink-3);
}
.empty-glyph {
  width: 56px; height: 56px; border-radius: 50%;
  animation: float 5s var(--ease-in-out) infinite alternate;
  display: grid; place-items: center;
  background: var(--bg-2); border: 1px solid var(--line-2);
  color: var(--ink-3); margin-bottom: 8px;
  position: relative;
}
.empty-glyph .ico { width: 22px; height: 22px; }
.empty h3 { margin: 0; color: var(--ink); font-size: 14.5px; font-weight: 620; }
.empty p { margin: 0; font-size: 13px; max-width: 300px; }

/* --- Email frame ------------------------------------------------------- */
/* The iframe is sized to its document, so the reader scrolls as one page.
   Content wider than the pane is zoomed to fit, or scrolls sideways here.
   flex: none — inside the reader's flex column it must never shrink, or the
   mail is clipped to the space left under the header and nothing scrolls. */
.mail-frame-wrap { position: relative; display: flex; flex-direction: column; gap: 14px; flex: none; }
.mail-frame-scroll {
  overflow-x: auto; overflow-y: hidden;
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--line-2);
  overscroll-behavior-x: contain;
}
.mail-frame-scroll.is-wide { position: relative; box-shadow: 0 0 0 1px var(--line-2), inset -24px 0 18px -18px rgba(0, 0, 0, .18); }
.wide-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.wide-hint .ico { width: 13px; height: 13px; }
.mail-frame {
  display: block;
  width: 100%; height: 160px;
  border: 0;
  background: var(--paper);
  color-scheme: light;
}
.mail-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  font-size: 14.5px; line-height: 1.7; color: var(--ink);
  padding: 2px 2px 8px;
}
.mail-text a { color: var(--accent-text); text-underline-offset: 2px; }
.mail-text .q { color: var(--ink-3); border-left: 2px solid var(--line-3); padding-left: 10px; display: block; }
.mail-empty { display: flex; align-items: center; gap: 10px; padding: 16px; border-radius: 14px; background: var(--bg-2); color: var(--ink-2); font-size: 13.5px; }
.mail-empty .ico { color: var(--ink-3); }
.fwd { border-radius: 16px; box-shadow: 0 0 0 1px var(--line-2) inset; background: var(--bg-2); padding: 14px; display: grid; gap: 12px; }
.fwd-head { display: grid; gap: 3px; font-size: 12.5px; color: var(--ink-2); padding: 0 2px; }
.fwd-head .label { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text); margin-bottom: 4px; }
.fwd-head .label .ico { width: 13px; height: 13px; }
.fwd-head strong { color: var(--ink); font-weight: 620; font-size: 14px; }
.fwd-files { display: flex; flex-wrap: wrap; gap: 6px; }
.img-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px 7px 12px; margin-bottom: 10px;
  border-radius: var(--r-sm);
  background: var(--bg-2); border: 1px solid var(--line-2);
  font-size: 12.5px; color: var(--ink-2);
}
.img-banner .ico { color: var(--ink-3); }
.img-banner span { flex: 1; min-width: 0; }
@media (max-width: 640px) {
  .img-banner { flex-wrap: wrap; }
  .img-banner span { flex-basis: calc(100% - 30px); }
}

.attachments { display: flex; flex-wrap: wrap; gap: 8px; }
.attachment {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px 7px 8px; min-width: 0; max-width: 280px;
  border-radius: var(--r-sm);
  background: var(--bg-2); border: 1px solid var(--line-2);
  text-decoration: none;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.attachment:hover { border-color: var(--line-3); background: var(--bg-3); }
.attachment-ext {
  width: 30px; height: 34px; border-radius: 5px; flex: none;
  display: grid; place-items: end center; padding-bottom: 5px;
  background: var(--bg-4); color: var(--ink-2);
  font-family: var(--f-mono); font-size: 9px; text-transform: uppercase;
  clip-path: polygon(0 0, 70% 0, 100% 24%, 100% 100%, 0 100%);
}
.attachment-meta { min-width: 0; display: grid; }
.attachment-meta strong { font-size: 12.5px; font-weight: 560; }
.attachment-meta span { font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-3); }
.attachment > .ico { color: var(--ink-3); margin-left: 4px; }

/* --- Charts ------------------------------------------------------------ */
.bars { display: block; width: 100%; height: 100%; overflow: visible; }
.bars rect.b { fill: var(--line-3); transition: fill var(--t-fast); transform-box: fill-box; transform-origin: 50% 100%; animation: grow .9s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 22ms); }
.bars rect.b.on { fill: var(--accent); }
@keyframes grow { from { transform: scaleY(0); } }
.bars rect.hit { fill: transparent; }
.bars g:hover rect.b { fill: var(--ink-2); }
.bars g:hover rect.b.on { fill: var(--accent-text); }
.bars line.base { stroke: var(--line-2); }
.barchart { display: flex; flex-direction: column; height: 100%; }
.barchart .bars { flex: 1; min-height: 0; }
.bars-axis { position: relative; height: 18px; flex: none; }
.bars-axis span { position: absolute; top: 5px; transform: translateX(-50%); font-family: var(--f-mono); font-size: 10px; color: var(--ink-3); white-space: nowrap; }
@media (max-width: 640px) { .bars-axis span:nth-of-type(even) { display: none; } }


/* --- Motion primitives -------------------------------------------------- */
@keyframes float { from { transform: translateY(-3px); } to { transform: translateY(3px); } }

.ind { pointer-events: none; }
.plate {
  position: absolute; left: 0; right: 0; top: 0; z-index: 0;
  background: var(--plate);
  opacity: 0; pointer-events: none;
  transition: transform .42s var(--ease), height .42s var(--ease), opacity .3s;
}

.w-mask { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.w { display: inline-block; transform-origin: 0 100%; }

.odo { display: inline-flex; line-height: 1; height: 1em; overflow: hidden; vertical-align: baseline; }
.odo-col { display: inline-block; height: 1em; overflow: hidden; }
.odo-strip { display: flex; flex-direction: column; transition: transform 1.1s var(--ease); }
.odo-strip > span { height: 1em; display: block; text-align: center; }
.odo-sep { display: inline-block; }
.odo .odo-col, .odo .odo-strip, .odo .odo-strip > span, .odo .odo-sep { font: inherit; color: inherit; letter-spacing: inherit; }
.odo-col:nth-last-child(2) .odo-strip { transition-delay: 40ms; }
.odo-col:nth-last-child(3) .odo-strip { transition-delay: 80ms; }

/* Film grain for large surfaces — tactile, not glossy. */
.grain { position: relative; isolation: isolate; }
.grain::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 .95 0 0 0 0 .9 0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: .07; mix-blend-mode: overlay;
}
:root[data-theme='light'] .grain::after { opacity: .18; mix-blend-mode: multiply; filter: invert(1); }

/* View transitions */
::view-transition-group(*) { animation-duration: .55s; animation-timing-function: cubic-bezier(.16, 1, .3, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }
[data-vt='theme']::view-transition-old(root), [data-vt='theme']::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
[data-vt='theme']::view-transition-old(root) { z-index: 1; }
[data-vt='theme']::view-transition-new(root) { z-index: 2; }
::view-transition-old(main-view) { animation: .28s var(--ease-in-out) both vt-out; }
::view-transition-new(main-view) { animation: .6s var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-10px); filter: blur(4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }

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

/* ==========================================================================
   Phones — app chrome shared by the mailbox and the console.
   Query matches core.js PHONE: narrow screens, and phones held sideways.
   ========================================================================== */

/* Bottom sheets (openMenu on phones) */
.sheet-root {
  position: fixed; inset: 0; z-index: 110;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  background: var(--scrim);
  opacity: 0; transition: opacity .28s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.sheet-root.open { opacity: 1; }
.sheet-root.out { opacity: 0; pointer-events: none; }
.sheet {
  width: min(560px, 100%);
  max-height: calc(100dvh - 48px - env(safe-area-inset-top));
  display: flex; flex-direction: column;
  padding: 0 10px calc(10px + env(safe-area-inset-bottom));
  background: var(--bg-2);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -1px 0 var(--line-2), 0 -30px 60px -20px rgba(0, 0, 0, .5);
  transform: translateY(102%);
  transition: transform .42s var(--ease);
}
.sheet-root.open .sheet { transform: none; }
.sheet-root.out .sheet { transform: translateY(102%) !important; transition-duration: .3s; }
.sheet.dragging { transition: none; }
.sheet-grab { display: grid; place-items: center; height: 26px; flex: none; touch-action: none; }
.sheet-grab span { width: 38px; height: 5px; border-radius: 9px; background: var(--line-3); }
.sheet-title { padding: 2px 12px 12px; flex: none; touch-action: none; }
.sheet-list { overflow-y: auto; overscroll-behavior: contain; padding: 2px 0 6px; border-radius: 18px; }
.sheet .menu-item { height: 52px; padding: 0 14px; gap: 14px; border-radius: 14px; font-size: 16px; font-weight: 520; }
.sheet .menu-item .ico { width: 21px; height: 21px; }
.sheet .menu-item:hover { background: transparent; }
.sheet .menu-item:active { background: var(--bg-4); }
.sheet .menu-item .menu-meta { font-size: 13px; }
.sheet .menu-sep { margin: 6px 14px; }
.sheet .menu-head { padding: 12px 14px 4px; font-size: 12.5px; }
.sheet-cancel {
  flex: none; height: 52px; margin-top: 6px;
  border-radius: 16px; background: var(--bg-3);
  font-size: 16px; font-weight: 620; color: var(--ink);
}
.sheet-cancel:active { background: var(--bg-4); }

/* Bottom tab bar */
.tabbar { display: none; }
.tab {
  position: relative; flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: 56px; padding-top: 2px;
  color: var(--ink-3);
  font-size: 11px; font-weight: 600; letter-spacing: .01em;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  transition: color var(--t);
}
.tab-ico { position: relative; display: grid; place-items: center; width: 56px; height: 30px; border-radius: 99px; isolation: isolate; }
.tab-ico::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--accent-soft);
  opacity: 0; transform: scaleX(.4);
  transition: opacity .25s, transform .5s var(--ease-spring);
}
.tab .ico { width: 22px; height: 22px; transition: transform .5s var(--ease-spring); }
.tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab.active { color: var(--ink); }
.tab.active .ico { color: var(--accent-text); }
.tab.active .tab-ico::before { opacity: 1; transform: none; }
.tab:active .ico { transform: scale(.86); }
.tab .badge {
  position: absolute; top: -3px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px;
  font-size: 10.5px; font-weight: 600;
  box-shadow: 0 0 0 2px var(--bg);
}
.tab .badge:empty, .tab .badge:not(.badge-accent):not(.badge-warn) { display: none; }
.badge-warn { background: var(--warn); color: #1a1205; font-weight: 600; }

/* Bottom toolbar buttons: icon over a short label (data-label). */
.tb-btn {
  flex: 1 1 0; min-width: 0; height: 54px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: 14px;
  color: var(--ink-2);
  font-size: 10.5px; font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}
.tb-btn .ico { width: 22px; height: 22px; transition: transform .45s var(--ease-spring); }
.tb-btn:active { background: var(--bg-3); }
.tb-btn:active .ico { transform: scale(.86); }

/* Pull to refresh (phones) */
.ptr {
  --pull: 0;
  position: fixed; z-index: 25; left: 50%; top: calc(env(safe-area-inset-top) + 52px);
  width: 38px; height: 38px; margin-left: -19px; border-radius: 50%;
  display: none; place-items: center;
  background: var(--bg-3); color: var(--ink-2);
  box-shadow: var(--shadow-pop);
  pointer-events: none;
  opacity: clamp(0, calc(var(--pull) / 40), 1);
  transform: translateY(calc(var(--pull) * 1px - 60px)) scale(clamp(.5, calc(var(--pull) / 64), 1));
}
.ptr .ico { width: 18px; height: 18px; transform: rotate(calc(var(--pull) * 4deg)); }
.ptr.armed { color: var(--accent-text); }
.ptr.armed .ico { stroke-width: 2.2; }
.ptr.settle { transition: transform .35s var(--ease), opacity .25s; }
.ptr.busy { --pull: 64; opacity: 1; transition: transform .35s var(--ease); }
.ptr.busy .ico { animation: spin .7s linear infinite; }

/* Floating action button */
.fab { display: none; }

@media (max-width: 860px), (pointer: coarse) and (max-height: 520px) {
  :root { --dock: 0px; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { -webkit-tap-highlight-color: transparent; }
  button, a, label, .item, .mi, .trow { -webkit-touch-callout: none; touch-action: manipulation; }
  /* 16px stops iOS zooming into a field on focus. */
  .input, .select, textarea { font-size: 16px !important; }
  .input, .select { height: 44px; border-radius: 12px; }
  .btn { height: 42px; padding: 0 16px; border-radius: 12px; font-size: 14.5px; }
  .btn-sm { height: 36px; padding: 0 12px; border-radius: 10px; font-size: 13.5px; }
  .icon-btn { width: 42px; height: 42px; border-radius: 12px; }
  .icon-btn .ico { width: 19px; height: 19px; }
  .icon-btn-sm { width: 36px; height: 36px; border-radius: 10px; }
  .icon-btn-sm .ico { width: 17px; height: 17px; }
  .icon-btn:hover, .btn-ghost:hover { background: transparent; }
  .icon-btn:active { background: var(--bg-3); }
  .check { width: 22px; height: 22px; }
  .check span { width: 22px; height: 22px; border-radius: 7px; border-width: 2px; }
  .check span::after { width: 10px; height: 5.5px; }
  .seg button { height: 32px; padding: 0 13px; font-size: 14px; }
  kbd { display: none; }
  .menu-item .menu-meta kbd { display: none; }

  .toasts { bottom: calc(var(--dock) + 14px + env(safe-area-inset-bottom)); width: calc(100vw - 20px); transition: bottom .4s var(--ease); }
  .toast { width: 100%; min-height: 50px; border-radius: 16px; font-size: 14.5px; padding: 6px 6px 6px 16px; }
  .toast .btn { height: 38px; }

  /* Dialogs become sheets that ride above the keyboard. */
  .modal-root { place-items: end center; padding: 0 0 var(--kb, 0px); animation: fade-in .25s var(--ease); }
  .modal-root.out { animation: fade-out .26s var(--ease) forwards; }
  .modal, .modal-wide {
    width: min(560px, 100%);
    max-height: calc(100dvh - var(--kb, 0px) - 40px - env(safe-area-inset-top));
    border-radius: 26px 26px 0 0;
    animation: sheet-in .45s var(--ease);
  }
  .modal-root.out .modal { animation: sheet-out .26s var(--ease) forwards; }
  .modal::before { content: ''; display: block; flex: none; width: 38px; height: 5px; margin: 10px auto 0; border-radius: 9px; background: var(--line-3); }
  .modal-head { padding: 12px 20px 2px; }
  .modal-head h2 { font-size: 20px; }
  .modal-head p { font-size: 14px; }
  .modal-body { padding: 14px 20px; }
  .modal-foot {
    flex-direction: column-reverse; gap: 8px;
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
    background: transparent; border-top: 0;
  }
  .modal-root:has(.modal-foot) .modal-foot { padding-bottom: max(14px, calc(14px + env(safe-area-inset-bottom) - var(--kb, 0px))); }
  .modal-foot .btn { width: 100%; height: 50px; border-radius: 14px; font-size: 15.5px; }
  .modal-foot .spacer { display: none; }
  .modal:not(:has(.modal-foot)) .modal-body { padding-bottom: max(20px, calc(20px + env(safe-area-inset-bottom) - var(--kb, 0px))); }
  .modal-body > *, .modal-head > * { animation: none; }

  .tabbar {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    display: flex; align-items: stretch;
    padding: 0 max(6px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(6px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-top: 1px solid var(--line-2);
    transition: transform .4s var(--ease);
    /* Own layer: keeps the blur from dropping out while the list composites. */
    will-change: transform;
    isolation: isolate;
  }

  .fab {
    position: fixed; z-index: 28;
    right: max(16px, env(safe-area-inset-right)); bottom: calc(var(--dock) + 16px + env(safe-area-inset-bottom));
    display: inline-flex; align-items: center; gap: 10px;
    height: 54px; padding: 0 20px 0 17px;
    border-radius: 18px;
    background: var(--btn); color: var(--btn-ink);
    font-size: 15px; font-weight: 650;
    box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .2);
    transition: padding .4s var(--ease), gap .4s var(--ease), transform .4s var(--ease), opacity .25s;
    -webkit-tap-highlight-color: transparent;
  }
  :root[data-theme='light'] .fab { box-shadow: 0 10px 28px -10px rgba(60, 40, 20, .45), 0 2px 6px rgba(60, 40, 20, .12); }
  .fab .ico { width: 21px; height: 21px; }
  .fab span { max-width: 160px; overflow: hidden; white-space: nowrap; transition: max-width .4s var(--ease), opacity .3s; }
  .fab.mini { padding: 0 16px; gap: 0; }
  .fab.mini span { max-width: 0; opacity: 0; }
  .fab:active { transform: scale(.94); }
  .fab.gone { transform: translateY(140%); opacity: 0; pointer-events: none; }
  /* A snackbar pushes the button up instead of covering it. */
  body:has(.toast:not(.out)) .fab:not(.gone) { transform: translateY(-64px); }
  body:has(.toast:not(.out) + .toast:not(.out)) .fab:not(.gone) { transform: translateY(-122px); }
  .ptr { display: grid; }
}
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
.sheet-title > b { display: block; font-size: 15.5px; font-weight: 640; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-title > .mono { display: block; margin-top: 2px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Account header in sheets (phones) */
.acct-head { display: flex; align-items: center; gap: 12px; }
.acct-head .av { --_s: 46px; border-radius: 50%; font-size: 19px; }
.acct-meta { display: grid; gap: 3px; min-width: 0; }
.acct-meta b { font-size: 16px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-meta > span { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-3); }
.acct-meta .dot { background: var(--ink-4); }
.acct-meta .dot-live { background: var(--ok); }
.acct-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.acct-stats span { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--bg-3); font-size: 12px; color: var(--ink-3); }
.acct-stats b { font-family: var(--f-display); font-stretch: 112%; font-size: 22px; font-weight: 740; color: var(--ink); letter-spacing: -.03em; }
