/* ============================================================
   Cmail — Sanctuary design system
   Liquid-glass mood room · floating pill navigation shell
   ============================================================ */

/* ---------- fonts ---------- */
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('../fonts/DMSans-var.woff2') format('woff2-variations');
  font-weight: 100 1000;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --ease: cubic-bezier(.32, .72, 0, 1);          /* signature glide */
  --spring: cubic-bezier(.34, 1.42, .4, 1);      /* gentle spring */
  --speed: .32s;

  /* v3.2.5 — shared scales. The aliases keep legacy var names alive:
     --line / --text / --accent were REFERENCED by the domain wizard but
     never defined anywhere, so its step highlight silently lost its accent
     (border fell back to currentColor, the tint to transparent). */
  --liquid-blur: 16px;
  --blur-1: 7px;   --blur-2: 14px;  --blur-3: 22px;
  --dur-1: .16s;   --dur-2: .25s;   --dur-3: .4s;
  --line: var(--stroke);
  --text: var(--fg);
  --accent: var(--acc);

  /* the vertical scrollbar is reserved from the start — a list that grows
     past one screen no longer squeezes the layout sideways (classic jump) */
  scrollbar-gutter: stable;

  --font-fa: 'Vazirmatn', 'DM Sans', 'Segoe UI', Tahoma, sans-serif;
  --font-en: 'DM Sans', 'Vazirmatn', 'Segoe UI', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;

  --pill-h: 52px;
  --shell-top: 76px;   /* pillbar bottom + one breath */

  /* accent palettes (switch via html[data-accent]) */
  --acc-l: #aed890;  --acc-d: #4f8f60;  --acc-ink: #172b1b;
}
/* four palettes named after their actual color — nothing poetic, just the
   color itself; switching one repaints the whole room: background stage,
   glass tints, accents and highlights all follow */
html[data-accent='green']  { --acc-l: #b4cda3; --acc-d: #4f8f60; --acc-ink: #172b1b; --mood-bg: #161c17; --mood-bg-l: #f3f6ef; }
html[data-accent='blue']   { --acc-l: #9ec8dd; --acc-d: #3f7f9e; --acc-ink: #0c2430; --mood-bg: #131b21; --mood-bg-l: #eff4f6; }
html[data-accent='purple'] { --acc-l: #c2a7e2; --acc-d: #7e5fa6; --acc-ink: #221635; --mood-bg: #181522; --mood-bg-l: #f4f1f7; }
html[data-accent='amber']  { --acc-l: #eec27e; --acc-d: #a06a24; --acc-ink: #2d1f0c; --mood-bg: #1d1812; --mood-bg-l: #f7f3ea; }
/* accents older builds remember fall back to their real color */
html[data-accent='sage'], html[data-accent='emerald'], html[data-accent='ocean'],
html[data-accent='midnight'], html[data-accent='ice'] { --acc-l: #9ec8dd; --acc-d: #3f7f9e; --acc-ink: #0c2430; --mood-bg: #131b21; --mood-bg-l: #eff4f6; }
html[data-accent='serene'] { --acc-l: #9ec8dd; --acc-d: #3f7f9e; --acc-ink: #0c2430; --mood-bg: #131b21; --mood-bg-l: #eff4f6; }
html[data-accent='violet'], html[data-accent='sakura'],
html[data-accent='wine'], html[data-accent='coral'] { --acc-l: #c2a7e2; --acc-d: #7e5fa6; --acc-ink: #221635; --mood-bg: #181522; --mood-bg-l: #f4f1f7; }
html[data-accent='gold'] { --acc-l: #eec27e; --acc-d: #a06a24; --acc-ink: #2d1f0c; --mood-bg: #1d1812; --mood-bg-l: #f7f3ea; }

/* ---------- moods ---------- */
html[data-theme='dark'] {
  --bg: var(--mood-bg, #161c17);
  --bg-glow-1: color-mix(in srgb, var(--acc-l) 52%, transparent);
  --bg-glow-2: color-mix(in srgb, var(--acc-l) 33%, transparent);
  --bg-glow-3: color-mix(in srgb, var(--acc-d) 44%, transparent);

  --fg: #edf1ea;
  --muted: #94a091;
  --faint: #7e887a;

  --panel: rgba(255, 255, 255, .045);
  --panel-2: rgba(255, 255, 255, .062);
  --panel-3: rgba(255, 255, 255, .095);
  --stroke: rgba(255, 255, 255, .075);
  --stroke-2: rgba(255, 255, 255, .14);
  --inset: inset 1px 2px 3px rgba(255, 255, 255, .05), inset -1px -2px 4px rgba(255, 255, 255, .02);
  --shadow: 0 18px 44px -18px rgba(5, 10, 6, .6);
  --shadow-soft: 0 6px 18px -8px rgba(5, 10, 6, .5);

  --acc: var(--acc-l);
  --acc-soft: color-mix(in srgb, var(--acc-l) 16%, transparent);
  --acc-line: color-mix(in srgb, var(--acc-l) 34%, transparent);
  --acc-text: #10241a;

  --field: rgba(0, 0, 0, .24);
  --field-line: rgba(255, 255, 255, .09);
  --hover: rgba(255, 255, 255, .055);

  --danger: #e08888;
  --ok: #93c793;
  --warn: #dcb567;
  --scrim: rgba(8, 12, 9, .55);
}

html[data-theme='light'] {
  --bg: var(--mood-bg-l, #f3f6ef);
  --bg-glow-1: color-mix(in srgb, var(--acc-d) 38%, transparent);
  --bg-glow-2: color-mix(in srgb, var(--acc-l) 54%, transparent);
  --bg-glow-3: color-mix(in srgb, var(--acc-d) 24%, transparent);

  --fg: #1e251f;
  --muted: #6e796c;
  --faint: #5f6b60;

  --panel: rgba(255, 255, 255, .74);
  --panel-2: rgba(255, 255, 255, .92);
  --panel-3: #ffffff;
  --stroke: rgba(34, 46, 36, .1);
  --stroke-2: rgba(34, 46, 36, .17);
  --inset: inset 1px 2px 3px rgba(255, 255, 255, .85), inset -1px -2px 4px rgba(255, 255, 255, .45);
  --shadow: 0 16px 36px -18px rgba(44, 58, 44, .22);
  --shadow-soft: 0 6px 16px -8px rgba(44, 58, 44, .16);

  --acc: var(--acc-d);
  --acc-soft: color-mix(in srgb, var(--acc-d) 12%, transparent);
  --acc-line: color-mix(in srgb, var(--acc-d) 30%, transparent);
  --acc-text: #f7faf4;

  --field: rgba(255, 255, 255, .85);
  --field-line: rgba(34, 46, 36, .13);
  --hover: rgba(30, 37, 31, .055);

  --danger: #b3474c;
  --ok: #3e7d4e;
  --warn: #9a7420;
  --scrim: rgba(40, 52, 42, .32);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-fa);
  font-size: 14.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .6s var(--ease), color .45s var(--ease);
}
.glass { transition: background .5s var(--ease), border-color .5s var(--ease); }
html[lang='en'] body { font-family: var(--font-en); }

a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: none; filter: brightness(1.1); }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; }
::selection { background: color-mix(in srgb, var(--acc) 38%, transparent); }

* { scrollbar-width: thin; scrollbar-color: var(--stroke-2) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--stroke-2); border-radius: 99px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- the stage (ambient environment behind the whole app) ----------
   the room the app lives in: big soft glows tinted by the active mood, a
   slow light-beam sweeping the room, a gentle drift, film grain.
   v3.2.0 — the presence modes (aurora/halo/pure) retired: the living stage
   is the one and only backdrop, always alive (reduced-motion still quiets it) */
.bg-stage { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-stage::before, .bg-stage::after, .bg-stage i {
  content: ''; position: absolute; border-radius: 50%; filter: blur(110px);
  animation: bgDrift 26s ease-in-out infinite alternate;
}
.bg-stage::before {
  width: 66vmax; height: 66vmax; top: -26vmax; inset-inline-start: -16vmax;
  background: radial-gradient(circle at 50% 50%, var(--bg-glow-1), transparent 65%);
}
.bg-stage::after {
  width: 58vmax; height: 58vmax; bottom: -24vmax; inset-inline-end: -14vmax;
  background: radial-gradient(circle at 50% 50%, var(--bg-glow-2), transparent 62%);
  animation-duration: 34s;
  animation-delay: -12s;
}
.bg-stage i {
  width: 46vmax; height: 46vmax; bottom: -20vmax; inset-inline-start: 20vw;
  background: radial-gradient(circle at 50% 50%, var(--bg-glow-3), transparent 60%);
  animation-duration: 40s; animation-delay: -20s;
}
/* the beam — two soft sectors of accent light turning around the room once
   a minute; the whole stage slowly revolves instead of just breathing */
.bg-stage b {
  position: absolute; left: 50%; top: 50%;
  width: 145vmax; height: 145vmax; margin: -72.5vmax 0 0 -72.5vmax;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    transparent 0deg 34deg, var(--bg-glow-1) 84deg, transparent 138deg 196deg,
    var(--bg-glow-2) 262deg, transparent 318deg 360deg);
  filter: blur(90px);
  opacity: .62;
  animation: bgBeam 64s linear infinite;
}
/* the second beam — narrower, faster, turning against the first one; the
   two sweeps cross each other and the room never sits still */
.bg-stage b::before {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 105vmax; height: 105vmax; margin: -52.5vmax 0 0 -52.5vmax;
  border-radius: 50%;
  background: conic-gradient(from 140deg,
    transparent 0deg 20deg, var(--bg-glow-2) 62deg, transparent 108deg 236deg,
    var(--bg-glow-1) 288deg, transparent 334deg 360deg);
  opacity: .8;
  animation: bgBeamR 44s linear infinite;
}
@keyframes bgBeam { to { transform: rotate(1turn); } }
@keyframes bgBeamR { to { transform: rotate(-1turn); } }
@keyframes bgDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(3.5vmax, 2.5vmax, 0) scale(1.07); }
}
/* presence modes — retired in v3.2.0 (the stage is always alive) */
@media (prefers-reduced-motion: reduce) {
  .bg-stage::before, .bg-stage::after, .bg-stage i, .bg-stage b, .bg-stage b::before { animation: none; }
}
.bg-stage .grain {
  position: absolute; inset: 0; opacity: .45;
  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='.85' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='.035'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* the vignette — plain-mood mode only; scenes carry their own light */
.bg-stage .vig {
  position: absolute; inset: 0; opacity: 0; transition: opacity .5s;
  box-shadow: inset 0 0 20vmax rgba(3, 8, 5, .42);
}
.bg-stage .vig { opacity: 1; }
html[data-theme='light'] .bg-stage .vig { box-shadow: inset 0 0 18vmax rgba(46, 64, 48, .16); }

/* ---------- glass primitives ---------- */
.glass {
  background: var(--panel);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-soft), var(--inset);
  backdrop-filter: blur(var(--liquid-blur, 16px)) saturate(1.5);
  -webkit-backdrop-filter: blur(var(--liquid-blur, 16px)) saturate(1.5);
  border-radius: var(--radius);
}
.glass--strong { background: var(--panel-2); }
.card { border-radius: var(--radius); padding: 15px; }

/* card header used across views */
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-head .icn { color: var(--acc); }
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-head .end { margin-inline-start: auto; display: flex; gap: 4px; align-items: center; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 15px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  font-weight: 600; font-size: 13px;
  color: var(--fg);
  transition: transform .28s var(--spring), background .25s var(--ease), border-color .25s, box-shadow .25s, filter .25s;
  white-space: nowrap;
  user-select: none;
}
.btn:hover { background: var(--panel-3); box-shadow: var(--shadow-soft); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }

.btn--primary {
  background: var(--acc);
  border-color: transparent;
  color: var(--acc-text);
  font-weight: 700;
  box-shadow: 0 8px 22px -10px color-mix(in srgb, var(--acc) 55%, transparent), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn--primary:hover { background: var(--acc); filter: brightness(1.06); }
.btn--danger {
  background: color-mix(in srgb, var(--danger) 13%, transparent);
  border-color: color-mix(in srgb, var(--danger) 34%, transparent);
  color: var(--danger);
}
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--hover); box-shadow: none; }
.btn--sm { padding: 5px 11px; font-size: 12.5px; }
.btn--icon { padding: 8px; border-radius: 12px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--stroke);
  font-size: 12px; font-weight: 600; color: var(--muted);
  transition: all .25s var(--ease);
  cursor: pointer;
}
.chip:hover { color: var(--fg); border-color: var(--stroke-2); }
.chip.is-on {
  background: var(--acc-soft); color: var(--fg);
  border-color: var(--acc-line);
}
.chip svg { width: 13px; height: 13px; }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .2px; }
.input, textarea.input, select.input {
  width: 100%;
  background: var(--field);
  border: 1px solid var(--field-line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  outline: none;
  transition: border-color .25s, box-shadow .25s, background .25s;
  color: var(--fg);
  box-shadow: var(--inset);
}
.input:focus { border-color: var(--acc-line); box-shadow: 0 0 0 4px var(--acc-soft); }
.input::placeholder { color: var(--faint); }
select.input option { background: #222a24; color: #edf1ea; }
html[data-theme='light'] select.input option { background: #fff; color: #1e251f; }
textarea.input { resize: vertical; min-height: 90px; }

.switch { position: relative; width: 42px; height: 24px; border-radius: 99px; background: var(--field); border: 1px solid var(--field-line); transition: background .3s; flex: none; cursor: pointer; }
.switch::after { content: ''; position: absolute; inset-inline-start: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: all .3s var(--spring); }
.switch.is-on { background: var(--acc); border-color: transparent; }
.switch.is-on::after { inset-inline-start: 21px; background: var(--acc-text); }

input[type='range'] { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 99px; background: var(--field); border: 1px solid var(--field-line); outline: none; }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--acc); cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
input[type='range']::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--acc); cursor: pointer; }

/* ---------- floating pill navigation ----------
   one glass island up top: brand · page pills · quick controls · avatar */
.pillbar {
  position: fixed; top: 14px; inset-inline: 0; z-index: 90;
  margin-inline: auto;
  width: fit-content; max-width: min(96.5vw, 1080px);
  height: var(--pill-h);
  display: flex; align-items: center; gap: 6px;
  padding: 0 9px;
  background: color-mix(in srgb, var(--bg) 58%, transparent);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  backdrop-filter: blur(22px) saturate(1.55);
  -webkit-backdrop-filter: blur(22px) saturate(1.55);
  box-shadow: var(--shadow), var(--inset);
  transition: background .5s var(--ease), border-color .5s var(--ease);
}
.pillbar__brand {
  display: flex; align-items: center; gap: 9px;
  padding-inline: 8px 6px; text-decoration: none; color: var(--fg);
  border-radius: 999px; transition: opacity .2s;
}
.pillbar__brand:hover { opacity: .85; text-decoration: none; }
/* the brand mark stays itself: the real Cmail glyph, white by night and
   black by day — reverted after the mask-tint experiment read badly */
.pillbar__logo {
  width: 29px; height: 29px; object-fit: contain; border-radius: 9px;
}
html[data-theme='dark'] .pillbar__logo { content: url('../img/icon-white.png'); }
html[data-theme='light'] .pillbar__logo { content: url('../img/icon-black.png'); }
.pillbar__name { font-weight: 800; font-size: 16.5px; letter-spacing: .2px; }
.pillbar__ver {
  font-size: 9.5px; font-weight: 800; font-family: var(--font-mono);
  padding: 1.5px 7px; border-radius: 99px;
  background: var(--acc-soft); color: var(--acc); border: 1px solid var(--acc-line);
  transform: translateY(-5px);
}
.pillbar__nav { display: flex; align-items: center; gap: 3px; margin-inline: 8px; min-width: 0; position: relative; }
.pill-nav {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  border: 1px solid transparent;
  transition: color .25s var(--ease), background .25s var(--ease);
  text-decoration: none; white-space: nowrap;
  position: relative; z-index: 1;
}
.pill-nav svg { width: 15px; height: 15px; flex: none; }
.pill-nav:hover { color: var(--fg); background: var(--hover); text-decoration: none; }
.pill-nav.is-on {
  color: var(--fg);
  background: transparent;
  border-color: transparent;
}
.pill-nav.is-on svg { color: var(--acc); }
/* the gliding indicator: a pill of frosted glass that travels under the
   active page — soft landing, springy exit, glassy all the way */
.pill-glider {
  position: absolute; top: 0; left: 0; height: calc(100% + 2px);
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  box-shadow: var(--inset), 0 4px 14px -6px rgba(0, 0, 0, .25);
  backdrop-filter: blur(12px) saturate(1.5);
  -webkit-backdrop-filter: blur(12px) saturate(1.5);
  transition: transform .45s var(--spring), width .45s var(--spring), opacity .3s;
  pointer-events: none;
  z-index: 0;
  will-change: transform, width;
}
.pill-nav .badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 99px; background: var(--acc); color: var(--acc-text);
  font-size: 10px; font-weight: 800; line-height: 18px; text-align: center;
}
.pillbar__end { display: flex; align-items: center; gap: 2px; margin-inline-start: auto; padding-inline-start: 6px; }
.pillbar__sep { width: 1px; height: 22px; background: var(--stroke); margin-inline: 7px; flex: none; }

.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--acc); color: var(--acc-text);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12.5px; flex: none;
  transition: transform .25s var(--spring), box-shadow .25s;
}
button.avatar:hover { transform: scale(1.08); box-shadow: 0 0 0 3px var(--acc-soft); }

/* ---------- account switcher (the avatar circle) ----------
   every mailbox is its own account — pick one, add one, manage them all */
.acct-menu {
  position: fixed; z-index: 140;
  width: min(344px, calc(100vw - 18px));
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: pop .32s var(--spring);
  transform-origin: top;
}
.acct-menu__head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 17px 13px;
  border-bottom: 1px solid var(--stroke);
}
.acct-menu__head .avatar { width: 42px; height: 42px; font-size: 17px; border-radius: 15px; }
.acct-menu__id { min-width: 0; flex: 1; }
.acct-menu__name { font-size: 14px; font-weight: 800; line-height: 1.35; }
.acct-menu__sub { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.acct-menu__list { max-height: min(308px, 42vh); overflow-y: auto; padding: 8px; }
.acct-menu__label {
  font-size: 10px; font-weight: 800; letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--faint); padding: 8px 10px 5px;
}
.acct-row {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 9px 11px; border-radius: 14px;
  text-align: start; border: 1px solid transparent;
  transition: background .2s, border-color .2s;
}
.acct-row:hover { background: var(--hover); }
.acct-row.is-on { background: var(--acc-soft); border-color: var(--acc-line); }
.acct-row__ava {
  width: 37px; height: 37px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-weight: 800; font-size: 14.5px; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.acct-row__body { flex: 1; min-width: 0; }
.acct-row__addr {
  font-size: 12.5px; font-weight: 700; direction: ltr; text-align: start;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acct-row__meta {
  font-size: 10.5px; color: var(--muted);
  display: flex; gap: 8px; margin-top: 1.5px; flex-wrap: wrap;
}
.acct-row__meta svg { width: 11px; height: 11px; vertical-align: -1.5px; margin-inline-end: 3px; }
.acct-row__meta b { color: var(--fg); font-weight: 700; }
.acct-row__end { flex: none; display: flex; align-items: center; gap: 4px; }
.acct-row__check { color: var(--acc); display: inline-flex; }
.acct-row__badge {
  min-width: 18px; height: 18px; padding: 0 6px; border-radius: 99px;
  background: var(--acc); color: var(--acc-text);
  font-size: 10px; font-weight: 800; line-height: 18px; text-align: center;
}
.acct-menu__add {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 17px; font-size: 12.5px; font-weight: 700; color: var(--acc);
  border-top: 1px solid var(--stroke); transition: background .2s;
}
.acct-menu__add:hover { background: var(--hover); }
.acct-menu__add svg { width: 15px; height: 15px; }
.acct-menu__foot { display: flex; border-top: 1px solid var(--stroke); }
.acct-menu__foot button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 4px 11px; font-size: 10.5px; font-weight: 700; color: var(--muted);
  transition: all .2s; border-inline-start: 1px solid var(--stroke);
}
.acct-menu__foot button:first-child { border-inline-start: 0; }
.acct-menu__foot button:hover { color: var(--fg); background: var(--hover); }
.acct-menu__foot button svg { width: 16px; height: 16px; }
.acct-menu__foot button.is-danger { color: var(--danger); }

/* ---------- dedicated email page ---------- */
.reader { width: 100%; max-width: 980px; margin-inline: auto; display: flex; flex-direction: column; gap: 12px; animation: viewFade .3s var(--ease); }
.reader__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.reader__navbtns { display: flex; gap: 6px; margin-inline-start: auto; }
.reader__card { overflow: hidden; display: flex; flex-direction: column; }
.reader__card .viewer__head { padding: 20px 24px 14px; }
.reader__card .mtools { padding: 12px 24px 0; }
.reader__card .mail-frame-wrap { padding: 10px 24px 16px; }
.reader__card .attachments { padding: 10px 24px; }
.reader__card .note-panel { padding: 12px 24px 14px; }
.reader__subj { font-size: 20px; }
.reader__empty { flex: 1; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 11px;
  color: var(--muted);
  transition: all .25s var(--spring);
  position: relative;
}
.icon-btn:hover { background: var(--hover); color: var(--fg); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.is-on { color: var(--fg); background: var(--panel-2); }
.icon-btn .badge {
  position: absolute; top: 2px; inset-inline-end: 2px;
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 99px; background: var(--danger); color: #fff;
  font-size: 9.5px; font-weight: 800; line-height: 15px; text-align: center;
}

/* mobile tabbar (stays — the pillbar shrinks to brand + controls) */
.tabbar {
  display: none;
  position: fixed; bottom: 0; inset-inline: 0; z-index: 70;
  height: calc(58px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--stroke);
}
.tabbar__in { display: flex; height: 58px; }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10px; font-weight: 600; color: var(--muted);
  position: relative; text-decoration: none;
  transition: color .2s;
}
.tab svg { width: 19px; height: 19px; }
.tab.is-on { color: var(--fg); }
.tab.is-on svg { color: var(--acc); }
.tab .badge {
  position: absolute; top: 6px; inset-inline-start: calc(50% + 6px);
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 99px; background: var(--danger); color: #fff;
  font-size: 9.5px; font-weight: 800; line-height: 15px; text-align: center;
}
/* ---------- dropdown menu ---------- */
.menu {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0;
  min-width: 210px; padding: 7px;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 120;
  animation: pop .3s var(--spring);
  transform-origin: top;
}
.menu__item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8.5px 11px; border-radius: 9px;
  font-size: 13px; font-weight: 500; color: var(--fg);
  transition: background .2s;
  text-align: start;
}
.menu__item:hover { background: var(--hover); text-decoration: none; }
.menu__item svg { width: 15px; height: 15px; color: var(--muted); }
.menu__sep { height: 1px; background: var(--stroke); margin: 5px 4px; }
@keyframes pop { from { transform: scale(.94) translateY(-5px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- generic view layout ---------- */
.view { padding: var(--shell-top) 20px 40px; max-width: 1200px; width: 100%; margin-inline: auto; animation: viewFade .35s var(--ease); }
@keyframes viewFade { from { opacity: 0; } to { opacity: 1; } }
.view--full { display: flex; flex-direction: column; height: calc(100vh - var(--shell-top) - 14px); height: calc(100svh - var(--shell-top) - 14px); min-height: 0 !important; padding-bottom: 16px !important; max-width: none !important; }
/* when serious-issue banners take the top zone, content slides right under
   them — the reserved height is the banners' own measured height (var set by
   syncAlertChrome), never a guessed constant (v3.2.2) */
body.has-alert .view { padding-top: 14px; }
body.has-alert .view--full { height: calc(100vh - var(--shell-top) - var(--alert-h, 0px) - 14px); height: calc(100svh - var(--shell-top) - var(--alert-h, 0px) - 14px); }

/* page header: eyebrow · big title · sub */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 2px 2px 14px; flex-wrap: wrap; }
.eyebrow {
  display: flex; align-items: center; gap: 8px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 2.2px; text-transform: uppercase;
  color: var(--acc); margin-bottom: 5px;
}
.eyebrow::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--acc); opacity: .9; }
.page-title { font-size: clamp(24px, 3.4vw, 34px); font-weight: 600; letter-spacing: -.4px; margin: 0; line-height: 1.25; display: flex; align-items: center; gap: 12px; }
.page-title svg { width: 24px; height: 24px; color: var(--acc); flex: none; }
.page-sub { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 10px;
  padding-block: 9px 11px; padding-inline: 14px 10px;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-radius: 13px;
  box-shadow: var(--shadow), var(--inset);
  font-size: 13px; font-weight: 600;
  animation: toastIn .5s var(--spring) both;
  max-width: 360px;
}
.toast__icn {
  flex: none; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 10px; color: #fff;
}
.toast__icn svg { width: 15px; height: 15px; }
.toast--ok .toast__icn { background: linear-gradient(135deg, var(--ok), color-mix(in srgb, var(--ok) 58%, #1c3326)); box-shadow: 0 6px 16px -7px color-mix(in srgb, var(--ok) 85%, transparent); }
.toast--err .toast__icn { background: linear-gradient(135deg, var(--danger), color-mix(in srgb, var(--danger) 58%, #43201f)); box-shadow: 0 6px 16px -7px color-mix(in srgb, var(--danger) 85%, transparent); }
.toast--info .toast__icn { background: linear-gradient(135deg, var(--acc-l), var(--acc-d)); box-shadow: 0 6px 16px -7px color-mix(in srgb, var(--acc) 85%, transparent); }
.toast__msg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast .toast__x {
  flex: none; width: 24px; height: 24px; border-radius: 8px;
  display: grid; place-items: center; color: var(--faint);
  transition: all .2s var(--spring);
}
.toast .toast__x:hover { color: var(--fg); background: var(--hover); }
.toast .toast__x:active { transform: scale(.85); }
.toast .toast__x svg { width: 13px; height: 13px; color: var(--faint); }
.toast__bar {
  position: absolute; inset-inline: 0; bottom: 0; height: 2.5px;
  background: linear-gradient(90deg, var(--acc-l), var(--acc-d));
  opacity: .85;
  animation: toastDrain linear forwards;
  transform-origin: left center;
}
html[dir='rtl'] .toast__bar { transform-origin: right center; }
.toast--ok .toast__bar { background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 30%, transparent)); }
.toast--err .toast__bar { background: linear-gradient(90deg, var(--danger), color-mix(in srgb, var(--danger) 30%, transparent)); }
.toast.hold .toast__bar { animation-play-state: paused; }
.toast.leaving { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { transform: translateY(20px) scale(.92); opacity: 0; } 62% { transform: translateY(-2px) scale(1.012); } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(10px) scale(.95); opacity: 0; } }
@keyframes toastDrain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ---------- modal ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 150;
  background: var(--scrim);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  display: grid; place-items: center;
  padding: 18px;
  animation: fadeIn .25s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(520px, 100%);
  max-height: min(86dvh, 780px);
  overflow: auto;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(28px) saturate(1.5);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow), var(--inset);
  padding: 18px;
  animation: modalIn .45s var(--spring);
}
.modal--wide { width: min(680px, 100%); }
@keyframes modalIn { from { transform: translateY(24px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal__title { font-size: 16.5px; font-weight: 700; margin: 0; display: flex; gap: 10px; align-items: center; }
.modal__title svg { width: 19px; height: 19px; color: var(--acc); }
.modal__body { display: flex; flex-direction: column; gap: 10px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* ---------- auth ---------- */
/* robust centering: flex + margin auto keeps the form centered when it fits
   and lets the page scroll from the top when the viewport is short — never clipped */
.view--auth { display: flex; overflow-y: auto; overflow-x: hidden; padding: max(20px, env(safe-area-inset-top)) 16px 28px; min-height: 100vh; min-height: 100svh; position: relative; max-width: none; }
.auth-wrap { width: min(440px, 100%); text-align: center; margin: auto; padding: 12px 0; }

/* live aurora behind the sign-in card — the stage breathes */
.auth-aurora { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.auth-aurora i {
  position: absolute; border-radius: 50%; filter: blur(90px);
  animation: auroraFloat 18s ease-in-out infinite alternate;
}
.auth-aurora i:nth-child(1) {
  width: 46vmax; height: 46vmax; top: -18vmax; inset-inline-start: -12vmax;
  background: radial-gradient(circle, color-mix(in srgb, var(--acc) 30%, transparent), transparent 62%);
}
.auth-aurora i:nth-child(2) {
  width: 40vmax; height: 40vmax; bottom: -16vmax; inset-inline-end: -10vmax;
  background: radial-gradient(circle, color-mix(in srgb, var(--acc-d) 26%, transparent), transparent 60%);
  animation-duration: 26s; animation-delay: -9s;
}
.auth-aurora i:nth-child(3) {
  width: 24vmax; height: 24vmax; top: 32%; inset-inline-end: 16%;
  background: radial-gradient(circle, color-mix(in srgb, var(--acc-l) 15%, transparent), transparent 58%);
  animation-duration: 32s; animation-delay: -16s;
}
@keyframes auroraFloat {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4vmax, -3vmax, 0) scale(1.12); }
}
@media (prefers-reduced-motion: reduce) { .auth-aurora i { animation: none; } }

/* hairline gradient ring around the sign-in card */
.auth-card { position: relative; border-radius: 22px; }
.auth-card::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--acc) 52%, transparent), transparent 36%, color-mix(in srgb, var(--acc-d) 38%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.auth-logo { display: block; margin-inline: auto; width: clamp(88px, 11vw, 112px); height: auto; aspect-ratio: 494 / 644; margin-bottom: 10px; animation: floaty 6s ease-in-out infinite; filter: drop-shadow(0 10px 26px color-mix(in srgb, var(--acc) 30%, transparent)); }
html[data-theme='dark'] .auth-logo { content: url('../img/logo-light.png'); }
html[data-theme='light'] .auth-logo { content: url('../img/logo-dark.png'); }

/* v3.0.0 — the two doors of the sign-in card: the owner's account door and
   the shared-access door. A slim segmented control rides above the card; the
   active door carries the accent pill that slides between the two. */
.auth-seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; position: relative;
  width: min(100%, 340px); margin: 2px auto 12px; padding: 4px;
  border-radius: 14px; background: color-mix(in srgb, var(--field) 72%, transparent);
  border: 1px solid var(--field-line); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .12);
}
.auth-seg__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8.5px 10px; border-radius: 10.5px; border: 0; cursor: pointer;
  background: transparent; color: var(--muted);
  font: inherit; font-size: 12.5px; font-weight: 750;
  transition: color .2s, background .25s var(--spring), box-shadow .25s;
}
.auth-seg__btn svg { width: 15px; height: 15px; }
.auth-seg__btn:hover { color: var(--fg); }
.auth-seg__btn.is-on {
  color: var(--acc-ink);
  background: linear-gradient(135deg, var(--acc-l), var(--acc-d));
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--acc) 65%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 32%, transparent);
}
/* the sigil above the shared door — two heads under one accent glass */
.auth-share__sigil {
  display: grid; place-items: center; width: 46px; height: 46px;
  margin: 0 auto 8px; border-radius: 15px;
  color: var(--acc-ink);
  background: linear-gradient(135deg, var(--acc-l), var(--acc-d));
  box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--acc) 70%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 35%, transparent);
}
.auth-share__sigil svg { width: 22px; height: 22px; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.auth-card { padding: clamp(20px, 2.2vw, 26px) clamp(18px, 2vw, 24px) 20px; margin-top: 10px; text-align: start; }
.auth-title { font-size: clamp(19px, 1.1vw + 13px, 22px); font-weight: 700; margin: 0 0 4px; letter-spacing: -.3px; }
.auth-sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; line-height: 1.8; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: var(--field); border: 1px solid var(--stroke); color: var(--muted); font-size: 11.5px; line-height: 1.75; text-align: start; }
.auth-note svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--acc); margin-top: 2px; }
.auth-alt { margin-top: 14px; font-size: 13px; color: var(--muted); text-align: center; }
.auth-foot { margin-top: 18px; font-size: 11.5px; color: var(--faint); text-align: center; }
.auth-ctrls { position: fixed; top: 18px; inset-inline-end: 18px; z-index: 50; display: flex; gap: 6px; }
/* short laptop windows: shrink the hero so the card — with its Sign-in button —
   always paints inside the first viewport; the brand row compresses in steps */
@media (max-height: 700px) {
  .auth-logo { width: 64px; animation: none; }
  .auth-foot { margin-top: 6px; }
  .auth-wrap { padding: 2px 0; }
  .auth-card { margin-top: 8px; }
  .auth-sub { margin-bottom: 12px; }
  .auth-help .rec-body { max-height: 46vh; overflow-y: auto; }
}
@media (max-height: 560px) {
  .view--auth { padding-top: 12px; }
  .auth-logo { width: 50px; }
  .auth-foot { display: none; }
  .auth-card { padding: 16px 16px 14px; }
  .auth-sub { margin-bottom: 10px; font-size: 12.5px; }
  .auth-form { gap: 8px; }
  .auth-help .rec-body { max-height: 38vh; }
}

/* ---------- setup gate width ---------- */
.dns-table { width: 100%; font-size: 12.5px; border-collapse: collapse; text-align: start; }
.dns-table th, .dns-table td { padding: 8px 10px; border-bottom: 1px solid var(--stroke); }
.dns-table th { color: var(--muted); font-weight: 600; }
.dns-table code { font-family: var(--font-mono); font-size: 11.5px; background: var(--field); padding: 2px 7px; border-radius: 7px; }
.copy-line {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--field); border: 1px solid var(--field-line); border-radius: var(--radius-sm);
  padding: 8px 12px; font-family: var(--font-mono); font-size: 12px;
  direction: ltr; text-align: left;
  box-shadow: var(--inset);
}
.copy-line button { color: var(--muted); } .copy-line button:hover { color: var(--fg); }

/* ---------- mail layout: account rail + one inbox card ---------- */
.mail {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  gap: 14px;
  flex: 1;
  min-height: 0;
}
.mail__col { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.mail__main { display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
.mail__scroll { overflow-y: auto; padding: 2px 10px 12px; flex: 1; }
.mail__scroll--rail { padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 11px; }

.addr-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9.5px 11px; border-radius: 12px;
  transition: background .2s, box-shadow .2s;
  text-align: start; position: relative;
  border: 1px solid transparent;
}
.addr-item:hover { background: var(--hover); }
.addr-item.is-on { background: var(--panel-2); border-color: var(--stroke); box-shadow: var(--inset); }
.addr-item__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.addr-item__body { min-width: 0; flex: 1; }
.addr-item__addr { display: block; font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: start; }
.addr-item__meta { font-size: 10.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.addr-item__badge { background: var(--acc); color: var(--acc-text); font-size: 10px; font-weight: 800; border-radius: 99px; padding: 1px 7px; flex: none; }
.kind-tag { font-size: 9px; font-weight: 800; padding: 1.5px 7px; border-radius: 99px; letter-spacing: .4px; }
.kind-tag--temp { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.kind-tag--perm { background: var(--acc-soft); color: var(--acc); }

.filters { display: flex; gap: 6px; padding: 0 16px 8px; flex-wrap: wrap; }
.filters .chip { padding: 4px 11px; font-size: 11.5px; white-space: nowrap; }
.chip--danger { color: var(--danger, #c0564f); border-color: color-mix(in srgb, var(--danger, #c0564f) 32%, transparent); }
.chip--danger:hover { background: color-mix(in srgb, var(--danger, #c0564f) 12%, transparent); }
.chip--manage { margin-inline-start: auto; color: var(--acc); border-color: var(--acc-line); }

/* ---------- the account oval: whose inbox this is, one clean statement ----------
   name + full address + copy — never a switcher (switching lives in the
   avatar circle at the top of the page) */
.mail__ovalrow {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-wrap: wrap; flex: none;
}
.acct-oval {
  display: inline-flex; align-items: center; gap: 11px; min-width: 0; max-width: 100%;
  padding-block: 8px; padding-inline: 9px 14px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--stroke);
  box-shadow: var(--inset), var(--shadow-soft);
  transition: border-color .25s, box-shadow .25s, transform .25s var(--spring);
}
.acct-oval:hover { border-color: var(--stroke-2); }
.acct-oval__ava {
  width: 38px !important; height: 38px !important; border-radius: 999px !important;
  font-size: 15px !important; margin-top: 0 !important; flex: none; cursor: default;
}
.acct-oval__txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
.acct-oval__name {
  font-size: 13.5px; font-weight: 800; letter-spacing: -.1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px;
}
.acct-oval__addr {
  font-size: 11px; color: var(--muted); font-weight: 600;
  direction: ltr; text-align: start;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px;
}
.acct-oval__copy {
  width: 31px; height: 31px; border-radius: 999px; flex: none;
  background: var(--field); border: 1px solid var(--field-line); color: var(--muted);
  transition: all .2s var(--ease);
}
.acct-oval__copy:hover { color: var(--acc); border-color: var(--acc-line); transform: translateY(-1px); }
.acct-oval__copy svg { width: 13.5px; height: 13.5px; }
.acct-oval__badge {
  background: var(--acc); color: var(--acc-text);
  font-size: 11px; font-weight: 800; border-radius: 99px; padding: 2.5px 9px; flex: none;
  box-shadow: 0 4px 14px -5px color-mix(in srgb, var(--acc) 70%, transparent);
  font-variant-numeric: tabular-nums;
}
.acct-oval__none { font-size: 13px; font-weight: 700; padding: 8px 6px; }

/* ---------- the account rail: compact identity + folders ---------- */
.rail-id {
  border-radius: 15px; padding: 11px; flex: none;
  background: var(--panel-2); border: 1px solid var(--stroke); box-shadow: var(--inset);
  display: flex; flex-direction: column; gap: 9px;
}
.rail-id__row { display: flex; align-items: center; gap: 9px; min-width: 0; }
.rail-id__t { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2.5px; }
.rail-id__name { font-size: 13px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-id__meta { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.rail-id__ttl {
  display: flex; align-items: center; gap: 5px;
  border-top: 1px solid var(--stroke); padding-top: 8px;
  font-size: 10.5px; color: var(--muted); font-weight: 650;
}
.rail-id__ttl svg { width: 12px; height: 12px; opacity: .8; }
.rail-manage {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: auto; padding: 9px; border-radius: 12px;
  border: 1px dashed var(--stroke-2); background: transparent;
  color: var(--muted); font-size: 11.5px; font-weight: 700; flex: none;
  transition: all .2s var(--ease);
}
.rail-manage:hover { color: var(--acc); border-color: var(--acc-line); background: var(--acc-soft); }
.rail-manage svg { width: 13px; height: 13px; }

/* ---------- the one card the whole inbox lives in ---------- */
.inbox-card {
  flex: 1; min-height: 0; position: relative;
  display: flex; flex-direction: column;
  border-radius: 18px; border: 1px solid var(--stroke);
  box-shadow: var(--inset), var(--shadow-soft);
  overflow: hidden;
}
.inbox-bar {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 13px; border-bottom: 1px solid var(--stroke); flex: none;
}
.inbox-bar .icon-btn svg { width: 15px; height: 15px; }
.inbox-bar__sp { flex: 1; }
.inbox-bar__meta {
  font-size: 11px; color: var(--muted); font-weight: 700; white-space: nowrap;
  display: inline-flex; gap: 5px; align-items: center; font-variant-numeric: tabular-nums;
}
.inbox-bar__meta b { color: var(--fg); font-weight: 800; }
.inbox-bar__warm { color: var(--warn); }

/* select-all box — a real checkbox when you reach for it */
.inbox-selbox {
  width: 17px; height: 17px; border-radius: 5.5px; flex: none;
  border: 1.5px solid var(--stroke-2); background: transparent;
  display: grid; place-items: center; position: relative;
  transition: all .18s var(--ease);
}
.inbox-selbox:hover { border-color: var(--acc); transform: scale(1.05); }
.inbox-selbox.is-on { background: var(--acc); border-color: var(--acc); }
.inbox-selbox.is-on::after {
  content: '✓'; color: var(--acc-text); font-size: 10.5px; font-weight: 900; line-height: 1;
}
.inbox-selbox.is-part::before {
  content: ''; position: absolute; width: 8px; height: 2px; border-radius: 2px;
  background: var(--acc);
}

/* the breathing dot: the inbox quietly refreshes itself */
.autodot {
  width: 7px; height: 7px; border-radius: 99px; flex: none;
  background: var(--acc); opacity: .7;
  animation: autobreath 2.8s ease-in-out infinite;
}
@keyframes autobreath { 0%, 100% { opacity: .3; transform: scale(.82); } 50% { opacity: .95; transform: scale(1.15); } }

/* bulk actions — a quiet strip that springs in over the toolbar's shadow */
.inbox-bulk {
  display: flex; gap: 6px; padding: 7px 12px; flex-wrap: wrap; flex: none;
  border-bottom: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--acc-soft) 55%, transparent);
  animation: bulkIn .28s var(--spring);
}
@keyframes bulkIn { from { opacity: 0; transform: translateY(-9px); } to { opacity: 1; transform: none; } }
.inbox-bulk .chip { padding: 4px 11px; font-size: 11.5px; white-space: nowrap; font-weight: 700; transition: transform .18s var(--spring), filter .15s; }
.inbox-bulk .chip:hover { transform: translateY(-1.5px); filter: brightness(1.05); }
.inbox-bulk .chip:active { transform: scale(.94); }

/* the slow-load strip: a spinner and honest words, only when it really drags */
.inbox-status {
  display: flex; align-items: center; gap: 9px; flex: none;
  padding: 8px 14px; border-bottom: 1px solid var(--stroke);
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  background: var(--panel-2);
}
.inbox-status__spin { display: inline-flex; animation: rot 1.1s linear infinite; color: var(--acc); }
.inbox-status__spin svg { width: 13px; height: 13px; }

.inbox-card__list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.inbox-card__center { height: 100%; display: grid; place-items: center; padding: 30px 18px; }

/* the "pick an account" empty state points at the avatar circle up top */
.empty__point {
  width: 54px; height: 54px; border-radius: 999px; margin-bottom: 10px;
  display: grid; place-items: center;
  background: var(--acc-soft); border: 1px solid var(--acc-line); color: var(--acc);
  animation: floaty 3.2s ease-in-out infinite;
}
.empty__point svg { width: 24px; height: 24px; margin: 0; }

/* skeleton rows — the list announces its shape before the data lands */
.skel-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-bottom: 1px solid var(--stroke);
}
.skel-row:last-child { border-bottom: 0; }
.skel-row__ava { width: 30px; height: 30px; border-radius: 10px; flex: none; }
.skel-row__mid { flex: 1; height: 11px; }

/* ---------- rows: one line each, the way a grown-up client reads ---------- */
.email-row {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 9.5px 14px;
  border: 0; border-bottom: 1px solid var(--stroke);
  cursor: pointer; text-align: start; position: relative;
  transition: background .15s var(--ease);
}
.email-row:last-child { border-bottom: 0; }
.email-row:hover { background: var(--hover); }
.email-row.is-cursor { background: var(--panel-2); }
.email-row.is-new { animation: newMailFlash 1.6s var(--ease); }
@keyframes newMailFlash { 0% { background: color-mix(in srgb, var(--acc) 22%, transparent); } 100% { background: transparent; } }
/* unread rows carry the room's accent: a slim bar on the speaking edge and
   a faint tint — the list reads like a checklist that knows what matters */
.email-row.is-unread { background: color-mix(in srgb, var(--acc) 4.5%, transparent); }
.email-row.is-unread::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 4px 4px 0; background: var(--acc); opacity: .8;
}
[dir='rtl'] .email-row.is-unread::before { border-radius: 4px 0 0 4px; }
.email-row.is-unread:hover { background: color-mix(in srgb, var(--acc) 7%, transparent); }
.email-row.is-unread .email-row__time { color: var(--acc); font-weight: 800; }
.email-row.is-selected { background: color-mix(in srgb, var(--acc) 8%, transparent); }
.email-row.is-selected::before { opacity: 0; }

/* the big-client trick: unread rows show a dot where the checkbox would
   be — reach for the row and the checkbox appears in its place */
.select-box {
  width: 17px; height: 17px; border-radius: 6px; flex: none;
  border: 1.5px solid transparent; background: transparent;
  display: grid; place-items: center; position: relative;
  transition: border-color .16s, background .16s;
}
.email-row:hover .select-box, .mail.is-selecting .select-box { border-color: var(--stroke-2); }
.email-row.is-unread .select-box::after {
  content: ''; width: 8px; height: 8px; border-radius: 99px; background: var(--acc);
  transition: opacity .15s;
}
.email-row:hover .select-box::after, .mail.is-selecting .select-box::after { opacity: 0; }
.email-row.is-selected .select-box { background: var(--acc); border-color: var(--acc); }
.email-row.is-selected .select-box::after { opacity: 0; }
.email-row.is-selected .select-box::before {
  content: '✓'; color: var(--acc-text); font-size: 10.5px; font-weight: 900; line-height: 1;
  position: absolute;
}

.email-row__ava {
  width: 30px; height: 30px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 12.5px;
  color: var(--acc-text); opacity: .95; cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease);
}
.email-row__ava:hover { transform: scale(1.06); }
.email-row.is-selected .email-row__ava { box-shadow: 0 0 0 2.5px var(--acc); opacity: 1; }
@media (hover: none) { .email-row__ava:hover { transform: none; } }
.email-row__from {
  width: 148px; flex: none; font-size: 12.8px; font-weight: 600; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.email-row.is-unread .email-row__from { font-weight: 800; color: var(--fg); }
.email-row__mid {
  flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 7px;
  white-space: nowrap; overflow: hidden;
}
.email-row__subj {
  font-size: 12.6px; font-weight: 600; flex: none; max-width: 46%;
  overflow: hidden; text-overflow: ellipsis;
  unicode-bidi: plaintext;   /* LTR subjects truncate at their own end, RTL at theirs */
}
.email-row.is-unread .email-row__subj { font-weight: 800; }
.email-row__sep { color: var(--faint); flex: none; user-select: none; }
.email-row__prev {
  flex: 1; min-width: 0; font-size: 11.8px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext;
}
.email-row__end { display: flex; align-items: center; gap: 8px; flex: none; }
.email-row__flags { display: flex; gap: 4px; }
.email-row__flags svg { width: 12px; height: 12px; }
.flag-star { color: var(--warn); } .flag-note { color: var(--acc); } .flag-clip { color: var(--muted); }
.email-row__time {
  font-size: 10.5px; color: var(--muted); flex: none;
  white-space: nowrap; min-width: 58px; text-align: end;
  font-variant-numeric: tabular-nums;
  transition: opacity .15s;
}
.email-row__star {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  color: var(--faint); opacity: 0; transition: opacity .15s, color .15s;
}
.email-row__star svg { width: 15px; height: 15px; }
.email-row__star.is-on { opacity: 1; color: var(--warn); }
.email-row__star.is-on svg { fill: currentColor; }
.email-row__star:active { transform: scale(.85); }
.email-row:hover .email-row__star { opacity: 1; }
@media (hover: none) { .email-row__star { opacity: 1; } }
/* v3.2.0 — the hover-pill star carries its own state: a starred mail shows
   the filled amber star inside the quick-actions pill, and every flip pops */
.email-row__qa-star.is-on { color: var(--warn); }
.email-row__qa-star.is-on svg { fill: currentColor; }
.email-row__qa button.star-pop, .email-row__star.star-pop { animation: starPop .32s var(--spring); }
@keyframes starPop {
  0% { transform: scale(.55) rotate(-20deg); }
  55% { transform: scale(1.28) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
  .email-row__qa button.star-pop, .email-row__star.star-pop { animation: none; }
}
.email-row__kebab {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  color: var(--muted); transition: opacity .15s, transform .2s var(--spring);
}
.email-row__kebab svg { width: 15px; height: 15px; }
.email-row__kebab:active { transform: scale(.85); }
@media (hover: hover) {
  .email-row__kebab { opacity: 0; }
  .email-row:hover .email-row__kebab, .email-row__kebab:focus-visible { opacity: 1; }
  .email-row:hover .email-row__time { opacity: 0; }
}
/* touch never relies on hover — the floating quick-actions stay retired */
@media (hover: none) {
  .email-row__qa { display: none !important; }
  .email-row:hover .email-row__time { opacity: 1; }
}
/* search inside list column */
.mail__search { margin: 0; padding: 9px 15px !important; border-radius: 13px !important; flex: none; }

/* ---------- the folder rail (this account's own boxes) ---------- */
.mail-folders { display: flex; flex-direction: column; gap: 2px; }
.mfolder {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8.5px 11px; border-radius: 11px;
  border: 1px solid transparent; background: transparent;
  font-size: 12.5px; font-weight: 650; color: var(--muted);
  cursor: pointer; text-align: start;
  transition: background .18s, color .18s, border-color .18s, box-shadow .18s;
}
.mfolder:hover { background: var(--hover); color: var(--fg); }
.mfolder.is-on {
  background: var(--acc-soft); border-color: var(--acc-line);
  color: var(--fg); font-weight: 800; box-shadow: var(--inset);
}
.mfolder__icn { display: inline-flex; color: var(--muted); transition: color .18s, transform .25s var(--spring); }
.mfolder__icn svg { width: 15.5px; height: 15.5px; }
.mfolder.is-on .mfolder__icn { color: var(--acc); transform: scale(1.06); }
.mfolder__t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mfolder__n {
  font-size: 10px; font-weight: 800; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--stroke);
  border-radius: 99px; padding: 1px 7px; flex: none;
  font-variant-numeric: tabular-nums;
}
.mfolder.is-on .mfolder__n { color: var(--acc); border-color: var(--acc-line); }
.mfolder__n--hot { background: var(--acc); color: var(--acc-text); border-color: transparent; }

/* ---------- viewer ---------- */
.viewer { display: flex; flex-direction: column; min-height: 0; }
.viewer__head { padding: 16px 20px 13px; border-bottom: 1px solid var(--stroke); }
.viewer__subj { font-size: 16.5px; font-weight: 700; margin: 0 0 11px; line-height: 1.5; letter-spacing: -.2px; }
.viewer__meta { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.viewer__meta .grow > div:first-child { direction: ltr; text-align: start; font-family: var(--font-en); }
.viewer__meta .grow > div:last-child { direction: ltr; text-align: start; }
.viewer__actions { display: flex; gap: 3px; margin-inline-start: auto; flex-wrap: wrap; justify-content: flex-end; }
.viewer__actions .btn { padding: 6px 11px; font-size: 12px; }
.viewer__body { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; min-height: 0; }

/* mail render toolbar (segmented) */
.mtools { display: flex; align-items: center; gap: 8px; padding: 10px 20px 0; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--field); border: 1px solid var(--field-line); }
.seg button {
  padding: 4.5px 13px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: var(--muted);
  transition: all .22s var(--ease); display: inline-flex; align-items: center; gap: 6px;
}
.seg button svg { width: 12px; height: 12px; }
.seg button.is-on { background: var(--panel-3); color: var(--fg); box-shadow: var(--shadow-soft), var(--inset); }
.seg button:hover:not(.is-on) { color: var(--fg); }

.mail-frame-wrap { flex: none; min-height: 0; display: flex; padding: 10px 20px 14px; }
.mail-frame {
  width: 100%; height: 100%; min-height: 300px; border: 0;
  border-radius: 12px; background: #fff; flex: 1;
  box-shadow: 0 2px 14px rgba(10, 16, 11, .12);
}
.mail-frame--narrow { width: 640px; max-width: 100%; margin-inline: auto; flex: none; }
html[data-theme='dark'] .mail-frame { background: #fbfcfa; }
.viewer__plain { font-family: var(--font-mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-word; direction: auto; text-align: start; padding: 6px 8px; }
.viewer-back { display: none !important; }
.attachments { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 20px; border-top: 1px solid var(--stroke); }
.att-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--stroke); font-size: 12px; font-weight: 600; transition: all .2s; }
.att-chip:hover { background: var(--panel-2); }

/* note panel */
.note-panel { border-top: 1px solid var(--stroke); padding: 12px 20px 14px; background: var(--acc-soft); }
.note-panel__head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.note-panel__head svg { width: 13px; height: 13px; color: var(--acc); }
.note-colors { display: flex; gap: 6px; margin-top: 8px; }
.note-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: all .2s var(--spring); }
.note-dot.is-on { border-color: var(--fg); transform: scale(1.16); }
.note-dot--amber { background: #dcb567; } .note-dot--mint { background: #93c793; } .note-dot--sky { background: #8fb8d8; }
.note-dot--rose { background: #dd9a9a; } .note-dot--violet { background: #b3a1d1; }

/* empty state */
.empty { display: grid; place-items: center; text-align: center; padding: 34px 18px; height: 100%; width: 100%; }
.empty svg { width: 42px; height: 42px; color: var(--faint); margin-bottom: 10px; }
.empty__t { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.empty__d { color: var(--muted); font-size: 12.5px; max-width: 260px; line-height: 1.6; }

/* skeleton */
.skel { border-radius: 12px; background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 50%, var(--panel) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- compose fab (mobile) ---------- */
.compose-fab {
  position: fixed; bottom: calc(74px + env(safe-area-inset-bottom)); inset-inline-end: 18px; z-index: 80;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--acc); color: var(--acc-text);
  display: grid; place-items: center;
  box-shadow: 0 12px 32px -8px color-mix(in srgb, var(--acc) 62%, transparent), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: transform .3s var(--spring);
}
.compose-fab:hover { transform: scale(1.07); }
.compose-fab svg { width: 22px; height: 22px; }
.compose-fab .lockbadge { position: absolute; top: -4px; inset-inline-end: -2px; }
.compose-fab.is-locked { filter: saturate(.55) brightness(.92); box-shadow: 0 12px 32px -10px rgba(140, 190, 225, .5), inset 0 1px 0 rgba(255, 255, 255, .2); }
@media (min-width: 861px) { .compose-fab { bottom: 26px; } }

/* ---------- responsibility badges (frozen lock / open lock / flame) ----------
   a tiny sign that rides beside a feature's own logo: icy snowflake-glass
   while an authorization or configuration is missing, a warm open shackle
   or flame once the owner accepts the responsibility */
.lockbadge {
  display: inline-flex; align-items: center; justify-content: center; gap: 1px;
  border-radius: 999px; flex: none; line-height: 0; vertical-align: middle;
}
.lockbadge svg { width: 9px; height: 9px; }
.lockbadge--frozen {
  padding: 3px;
  background: linear-gradient(135deg, #cfe9f8, #93c6e8);
  color: #0f3350;
  box-shadow: 0 0 0 1.5px rgba(170, 215, 242, .38), 0 1px 5px rgba(120, 185, 225, .45);
  animation: frostBreath 2.8s ease-in-out infinite;
}
@keyframes frostBreath {
  0%, 100% { box-shadow: 0 0 0 1.5px rgba(170, 215, 242, .35), 0 0 6px rgba(140, 200, 235, .25); }
  50%      { box-shadow: 0 0 0 1.5px rgba(170, 215, 242, .62), 0 0 13px rgba(140, 200, 235, .6); }
}
.lockbadge--open {
  padding: 3px;
  background: linear-gradient(135deg, #f8cf83, #e89a3c);
  color: #3c2407;
  box-shadow: 0 0 0 1.5px rgba(242, 199, 126, .4), 0 1px 5px rgba(230, 170, 80, .4);
}
.lockbadge--flame {
  background: linear-gradient(135deg, #ffb27a, #ef6a35);
  color: #43140a;
  animation: flameBreath 2.1s ease-in-out infinite;
}
@keyframes flameBreath {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 0 1.5px rgba(250, 170, 110, .4), 0 0 6px rgba(240, 130, 70, .3); }
  50%      { transform: scale(1.1);  box-shadow: 0 0 0 1.5px rgba(250, 170, 110, .62), 0 0 12px rgba(240, 130, 70, .55); }
}
/* a feature wearing its frozen badge reads slightly chilled */
.is-frozen { filter: saturate(.72) brightness(.96); }
/* ---------- vault ---------- */
.vault-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 13px; }
.totp-card { padding: 15px 17px; position: relative; overflow: hidden; transition: transform .3s var(--spring), box-shadow .3s; cursor: pointer; }
.totp-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.totp-card::before { content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 3.5px; background: var(--tc, var(--acc)); opacity: .9; }
.totp-card__top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.totp-card__top .grow { min-width: 0; }
.totp-card__top .row { flex: none; }
@media (max-width: 640px) {
  .totp-card { padding: 13px 14px; }
  .totp-card__code-row { gap: 9px; }
  .totp-card__acc { max-width: 100%; }
  .totp-card__acc span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.totp-card__icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: var(--acc-text); background: var(--tc, var(--acc)); flex: none; font-size: 14px; }
.totp-card__name { font-weight: 700; font-size: 13.5px; line-height: 1.3; }
.totp-card__issuer { font-size: 11px; color: var(--muted); }
.totp-card__code-row { display: flex; align-items: center; gap: 12px; }
.totp-code { font-family: var(--font-mono); font-size: 24px; font-weight: 700; letter-spacing: 2.5px; direction: ltr; flex: 1; white-space: nowrap; }
.totp-code .dim { opacity: .32; }
.totp-ring { --p: 100; width: 32px; height: 32px; flex: none; }
.totp-ring circle { fill: none; stroke-width: 3.5; }
.totp-ring .bg { stroke: var(--stroke-2); }
.totp-ring .fg { stroke: var(--tc, var(--acc)); stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; transition: stroke-dashoffset .5s linear; }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: start; color: var(--muted); font-weight: 600; font-size: 11px; padding: 8px 12px; border-bottom: 1px solid var(--stroke); white-space: nowrap; letter-spacing: .4px; text-transform: uppercase; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--stroke); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr { transition: background .2s; }
.tbl tbody tr:hover { background: var(--hover); }

/* ---------- setup gate (پیش‌نیازها) ---------- */
/* the gate column centers itself on the auth stage, like the sign-in card —
   horizontally always; vertically only from the top, because the open
   tutorials make the page taller than the viewport and flex auto-margins
   would clip the header */
.gate { width: min(680px, 100%); margin-inline: auto; margin-block: max(20px, env(safe-area-inset-top)) 28px; }
.gate__head { text-align: center; margin-bottom: 16px; }
/* display:block keeps the eyebrow badge on its OWN line — as an inline image
   it used to share one line box with the badge and the badge landed on the
   floating wordmark (worst on narrow phones) */
.gate__logo { display: block; width: 72px; height: auto; aspect-ratio: 494 / 644; animation: floaty 6s ease-in-out infinite; margin: 0 auto 12px; filter: drop-shadow(0 10px 26px color-mix(in srgb, var(--acc) 30%, transparent)); }
html[data-theme='dark'] .gate__logo { content: url('../img/logo-light.png'); }
html[data-theme='light'] .gate__logo { content: url('../img/logo-dark.png'); }
.gate__eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--muted); background: var(--panel); border: 1px solid var(--stroke);
  padding: 4px 12px; border-radius: 99px; margin-bottom: 12px; box-shadow: var(--inset);
}
.gate__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); animation: pulse 2s ease-in-out infinite; }
.gate__dot.is-off { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 20%, transparent); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.gate__title { font-size: clamp(24px, 4.5vw, 30px); font-weight: 700; letter-spacing: -.5px; margin: 0 0 6px; }
.gate__sub { color: var(--muted); font-size: 13px; max-width: 480px; margin: 0 auto; line-height: 1.85; }
.gate__card { padding: 18px 18px 8px; animation: fadeUp .6s var(--ease) both; }
.gate__card.is-done { border-color: color-mix(in srgb, var(--ok) 40%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 14%, transparent), var(--shadow-soft); }
.gate__top { display: flex; align-items: center; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--stroke); }
.gate__top-txt { flex: 1; min-width: 0; }
.gate__top-txt h2 { margin: 0 0 3px; font-size: 16.5px; letter-spacing: -.2px; }
.gate__top-txt p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.gate__auto { font-size: 11px; color: var(--faint); font-weight: 600; }
.ring { width: 84px; height: 84px; flex: none; position: relative; color: var(--acc); filter: drop-shadow(0 6px 16px color-mix(in srgb, var(--acc) 30%, transparent)); }
.ring__svg { width: 100%; height: 100%; display: block; }
.ring circle { transition: stroke-dashoffset .9s var(--ease); }
.ring__val { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 21px; letter-spacing: -.5px; }
.gate__checks { display: flex; flex-direction: column; padding-bottom: 8px; }
.check {
  display: flex; align-items: center; gap: 12px; padding: 11px 4px;
  border-bottom: 1px solid var(--stroke);
  animation: fadeUp .5s var(--ease) both;
}
.check__icn {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--field); border: 1px solid var(--field-line); color: var(--muted);
  flex: none; transition: all .35s var(--spring);
}
.check__icn svg { width: 18px; height: 18px; }
.check__txt { flex: 1; min-width: 0; }
.check__txt b { display: block; font-size: 13.5px; line-height: 1.5; }
.check__txt > span { display: block; font-size: 11.5px; color: var(--muted); }
/* the optional chip rides INSIDE the <b>: the old bare `span` selector used to
   turn it into a full-width block and stretch its dashed pill across the row */
.check__txt .chip-opt { display: inline-flex; margin-inline-start: 4px; vertical-align: 2px; }
.check__pill {
  font-size: 10.5px; font-weight: 800; padding: 4px 11px; border-radius: 99px;
  background: var(--field); color: var(--muted); border: 1px solid var(--field-line);
  flex: none; letter-spacing: .3px; transition: all .3s;
}
.check.is-ok .check__icn { background: color-mix(in srgb, var(--ok) 13%, transparent); border-color: color-mix(in srgb, var(--ok) 34%, transparent); color: var(--ok); transform: scale(1.04); }
.check.is-ok .check__pill { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.check.is-bad .check__icn { background: color-mix(in srgb, var(--danger) 11%, transparent); border-color: color-mix(in srgb, var(--danger) 32%, transparent); color: var(--danger); }
.check.is-bad .check__pill { background: color-mix(in srgb, var(--danger) 11%, transparent); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.check.is-unk .check__icn { animation: pulse 1.4s ease-in-out infinite; }
.check.pop { animation: pop .5s var(--spring); }
.check__tut { animation: fadeUp .45s var(--ease) both; padding: 4px 4px 10px; border-bottom: 1px solid var(--stroke); }
.check__tut:last-child { border-bottom: 0; }
.offline-icn {
  width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--danger) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 26%, transparent);
  color: var(--danger); flex: none;
}
.offline-icn svg { width: 36px; height: 36px; }

/* tutorial panel (آموزش گام‌به‌گام) */
.tut {
  background: var(--field); border: 1px solid var(--field-line);
  border-radius: var(--radius-sm); padding: 12px 13px;
  box-shadow: var(--inset); text-align: start;
}
.tut__head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 800; margin-bottom: 10px; }
.tut__head svg { width: 15px; height: 15px; color: var(--acc); flex: none; }
.tut__step { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; line-height: 1.75; }
.tut__step + .tut__step { margin-top: 9px; }
.tut__n {
  width: 20px; height: 20px; border-radius: 7px; background: var(--acc); color: var(--acc-text);
  font-size: 10.5px; font-weight: 800; display: grid; place-items: center; flex: none; margin-top: 3px;
}
.tut__step-b { min-width: 0; flex: 1; }
.tut__d { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.tut__cta { margin-top: 10px; }
/* one-click database initialization */
.init-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.init-cta { padding: 11px 18px; font-size: 13.5px; border-radius: 13px; }
.init-cta svg { width: 18px; height: 18px; }
.init-cta.is-busy { animation: initPulse 1.1s ease-in-out infinite; pointer-events: none; }
@keyframes initPulse {
  0%, 100% { filter: brightness(1); box-shadow: 0 8px 22px -10px color-mix(in srgb, var(--acc) 55%, transparent); }
  50% { filter: brightness(1.14); box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--acc) 70%, transparent); }
}
.init-st { font-size: 12.5px; color: var(--muted); }
.init-st:empty { display: none; }
details.tut__manual {
  margin-top: 12px; border: 1px dashed var(--line); border-radius: 12px;
  padding: 9px 13px; background: color-mix(in srgb, var(--panel-2) 55%, transparent);
}
details.tut__manual summary {
  cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--muted);
  list-style: none; user-select: none;
}
details.tut__manual summary::-webkit-details-marker { display: none; }
details.tut__manual summary::before { content: '▸ '; }
details.tut__manual[open] summary::before { content: '▾ '; }
details.tut__manual[open] { padding-bottom: 13px; }
details.tut__manual .term { margin-top: 8px; }
.tut__dns { margin-top: 12px; }
.tut .term, .tut .gate__form, .tut .gate__inline { margin-top: 7px; }
.term {
  display: flex; align-items: center; gap: 8px;
  background: #10160f; border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 10px; padding: 8px 11px;
  direction: ltr; font-family: var(--font-mono); font-size: 11.5px;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, .4);
}
html[data-theme='light'] .term { background: #17211a; border-color: transparent; }
.term__sign { color: #93c793; font-weight: 800; user-select: none; }
.term code { flex: 1; overflow-x: auto; white-space: nowrap; color: #d8e5d3; scrollbar-width: none; }
.term__copy { color: #87997f; display: inline-flex; flex: none; }
.term__copy:hover { color: #fff; }
.term__copy svg { width: 14px; height: 14px; }
.gate__inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.gate__form { display: grid; gap: 9px; max-width: 430px; }
.gate__form .btn { justify-self: start; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- about ---------- */
/* the sibling-project ribbon — a slow aurora band for Climind-W */
.ab-ribbon {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 14px 0 4px; padding: 13px 16px;
  border-radius: 16px; border: 1px solid var(--stroke);
  background: var(--panel); color: var(--fg);
  text-decoration: none; cursor: pointer;
  transition: transform .3s var(--spring), box-shadow .3s, border-color .3s;
  animation: fadeUp .5s var(--ease) both;
}
.ab-ribbon:hover { transform: translateY(-2px); border-color: var(--acc-line); box-shadow: var(--shadow); }
.ab-ribbon__aurora {
  position: absolute; inset: -60% -10%; z-index: -1; pointer-events: none;
  background: conic-gradient(from 0deg,
    color-mix(in srgb, #3b82f6 24%, transparent),
    color-mix(in srgb, #06b6d4 20%, transparent),
    color-mix(in srgb, #8b5cf6 24%, transparent),
    color-mix(in srgb, #22d3ee 18%, transparent),
    color-mix(in srgb, #3b82f6 24%, transparent));
  filter: blur(46px) saturate(1.15);
  opacity: .5; animation: ribbonSpin 14s linear infinite;
}
@keyframes ribbonSpin { to { transform: rotate(1turn); } }
.ab-ribbon__mark {
  width: 42px; height: 42px; border-radius: 14px; flex: none;
  display: grid; place-items: center; color: #eaf4ff;
  background: linear-gradient(135deg, #2563eb, #06b6d4 55%, #8b5cf6);
  box-shadow: 0 8px 22px -8px rgba(37, 99, 235, .65), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.ab-ribbon__mark svg { width: 21px; height: 21px; }
.ab-ribbon__txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ab-ribbon__txt b { font-size: 14.5px; font-weight: 800; letter-spacing: .2px; display: inline-flex; align-items: center; gap: 6px; }
/* v3.0.0 — the little Climind-W mark beside the ribbon's name: drawn on
   currentColor so it re-tints with the mood (deep accent by day, light by
   night) — the sibling logo the About section was missing */
.ab-ribbon__sigil { display: inline-flex; color: var(--acc-d); }
.ab-ribbon__sigil svg { width: 15px; height: 15px; }
html[data-theme='dark'] .ab-ribbon__sigil { color: var(--acc-l); }
html[data-theme='dark'] .ab-ribbon__sigil svg { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--acc-l) 55%, transparent)); }
.ab-ribbon__d { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.ab-ribbon__chip {
  font-size: 9.5px; font-weight: 800; letter-spacing: .5px;
  color: #eaf2ff; background: #2563eb;
  border: 1px solid color-mix(in srgb, #60a5fa 60%, transparent);
  border-radius: 99px; padding: 3px 10px; white-space: nowrap;
}
.ab-ribbon__cta {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 12px; font-weight: 800; color: #eaf4ff;
  background: linear-gradient(135deg, #2563eb, #0891b2);
  border-radius: 11px; padding: 7.5px 14px;
  box-shadow: 0 8px 20px -8px rgba(8, 145, 178, .6);
  transition: transform .25s var(--spring), filter .2s;
}
.ab-ribbon__cta svg { width: 14px; height: 14px; transition: transform .25s var(--spring); }
.ab-ribbon:hover .ab-ribbon__cta { transform: translateX(-2px); filter: brightness(1.08); }
.ab-ribbon:hover .ab-ribbon__cta svg { transform: translateX(2px); }
[dir='rtl'] .ab-ribbon:hover .ab-ribbon__cta svg { transform: translateX(-2px); }

/* mobile ribbon: a real grid — mark+text on the first row, chip+cta on the
   second; the flex-shrink version crushed the text into a 40px column */
@media (max-width: 640px) {
  .ab-ribbon {
    display: grid; grid-template-columns: auto minmax(0, 1fr);
    align-items: center; gap: 10px 11px;
    padding: 14px; margin: 12px 0 2px;
  }
  .ab-ribbon__mark { width: 40px; height: 40px; border-radius: 13px; }
  .ab-ribbon__mark svg { width: 19px; height: 19px; }
  .ab-ribbon__txt { display: flex; flex-direction: column; min-width: 0; }
  .ab-ribbon__txt b { font-size: 14px; white-space: nowrap; }
  .ab-ribbon__d { font-size: 11px; }
  .ab-ribbon__chip { grid-row: 2; grid-column: 1; justify-self: start; }
  .ab-ribbon__cta { grid-row: 2; grid-column: 2; justify-self: end; }
  /* the spinning aurora is a GPU hog on phones — a still glow reads the same */
  .ab-ribbon__aurora { animation: none; opacity: .42; filter: blur(30px) saturate(1.15); }
}

.ab-hero { position: relative; overflow: hidden; text-align: center; padding: 28px 20px 22px; animation: fadeUp .5s var(--ease) both; }
.ab-hero__glow { position: absolute; inset: -30%; background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--acc) 15%, transparent), transparent 55%); pointer-events: none; }
.ab-hero > * { position: relative; }
.ab-logo { width: 82px; height: auto; aspect-ratio: 494 / 644; margin-bottom: 8px; animation: floaty 6s ease-in-out infinite; filter: drop-shadow(0 14px 34px color-mix(in srgb, var(--acc) 38%, transparent)); }
html[data-theme='dark'] .ab-logo { content: url('../img/logo-light.png'); }
html[data-theme='light'] .ab-logo { content: url('../img/logo-dark.png'); }
.ab-title { font-size: 30px; font-weight: 800; letter-spacing: -.8px; margin: 0 0 8px; }
.ab-lead { color: var(--muted); font-size: 13.5px; max-width: 560px; margin: 0 auto; line-height: 1.95; }
.ab-hero__meta { display: flex; justify-content: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.ab-hero__links { display: flex; justify-content: center; gap: 9px; margin-top: 14px; flex-wrap: wrap; }
.ab-h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; margin: 20px 2px 12px; letter-spacing: -.2px; }
.ab-h2 svg { width: 17px; height: 17px; color: var(--acc); }
.ab-grid__in { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 12px; }
.ab-card { padding: 15px; animation: fadeUp .5s var(--ease) both; transition: transform .3s var(--spring), box-shadow .3s; }
.ab-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.ab-card__icn {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--acc-soft); border: 1px solid var(--acc-line); color: var(--acc); margin-bottom: 10px;
}
.ab-card__icn svg { width: 18px; height: 18px; }
.ab-card h3 { margin: 0 0 4px; font-size: 14px; }
.ab-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.ab-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; margin-top: 12px; }
.ab-stat { padding: 13px 14px; display: flex; align-items: center; gap: 11px; animation: fadeUp .5s var(--ease) both; }
.ab-stat b { font-size: 16px; letter-spacing: -.3px; display: block; line-height: 1.3; direction: ltr; white-space: nowrap; }
.ab-stat span { font-size: 10.5px; color: var(--muted); display: block; }
.ab-stat__icn { width: 34px; height: 34px; border-radius: 11px; background: var(--acc-soft); color: var(--acc); display: grid; place-items: center; flex: none; border: 1px solid var(--acc-line); }
.ab-stat__icn svg { width: 16px; height: 16px; }
.ab-stack { margin-top: 12px; padding: 13px 16px; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; text-align: center; }
.ab-stack__t { font-size: 12px; color: var(--muted); font-weight: 700; flex-basis: 100%; }
.ab-stack__chips { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; }
.chip--link { text-decoration: none; color: var(--fg); }
.chip--link:hover { color: var(--acc); border-color: var(--acc-line); }
/* ---------- the maker card — gradient ring, glow, real buttons ---------- */
.ab-creator {
  margin-top: 12px; padding: 20px; display: flex; gap: 16px; align-items: center;
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
}
.ab-creator::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--acc) 55%, transparent), transparent 38%, color-mix(in srgb, var(--acc-d) 42%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.ab-creator__glow {
  position: absolute; inset: -40%; pointer-events: none;
  background: radial-gradient(circle at 18% 50%, color-mix(in srgb, var(--acc) 16%, transparent), transparent 52%);
}
.ab-creator > * { position: relative; }
.ab-creator__ava {
  width: 64px; height: 64px; border-radius: 20px; font-size: 26px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--acc-l), var(--acc-d)); color: var(--acc-ink);
  font-weight: 800; font-family: var(--font-en);
  box-shadow: 0 16px 44px -10px color-mix(in srgb, var(--acc) 60%, transparent), var(--inset);
  animation: floaty 7s ease-in-out infinite;
}
.ab-creator__id { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ab-creator__txt h3 { margin: 0; font-size: 17px; letter-spacing: -.3px; font-family: var(--font-en); }
.ab-creator__txt p { margin: 7px 0 12px; color: var(--muted); font-size: 12.5px; line-height: 1.85; max-width: 62ch; }
.ab-creator__links { display: flex; gap: 8px; flex-wrap: wrap; }
.ab-made { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--faint); font-size: 12px; margin: 18px 0 6px; flex-wrap: wrap; }
/* the heart in “made with <3 and a bit of obsession” — an SVG glyph, not an
   emoji: it inherits the accent and never collapses into a tofu box */
.ab-made__heart { display: inline-flex; color: var(--acc); }
.ab-made__heart svg { width: 13px; height: 13px; fill: color-mix(in srgb, var(--acc) 42%, transparent); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--acc) 45%, transparent)); }
.version-pill { display: inline-flex; padding: 4px 14px; border-radius: 99px; background: var(--field); border: 1px solid var(--field-line); font-size: 11.5px; font-weight: 700; color: var(--muted); font-family: var(--font-mono); }

@media (max-width: 860px) {
  .gate__top { flex-direction: column; text-align: center; gap: 10px; }
  .gate__top .row { justify-content: center; flex-wrap: wrap; }
  .ab-creator { flex-direction: column; text-align: center; align-items: center; }
  .ab-creator__txt h3 { justify-content: center; }
  .ab-creator__links { justify-content: center; }
  .ab-stats { grid-template-columns: repeat(2, 1fr); }
  .term { font-size: 10.5px; padding: 7px 9px; }
  .gate__card { padding: 14px 12px 6px; }
}

/* feature checklist (✓ list) */
.check-list { display: flex; flex-direction: column; gap: 9px; text-align: start; }
.check-list .ck { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--fg); }
.check-list .ck svg { width: 15px; height: 15px; color: var(--acc); flex: none; margin-top: 3px; }

/* ---------- help ---------- */
.step-list { display: flex; flex-direction: column; gap: 0; margin-top: 6px; }
.step-row { display: flex; gap: 14px; padding: 12px 0; }
.step-row__num { width: 29px; height: 29px; border-radius: 10px; background: var(--acc); color: var(--acc-text); font-weight: 800; display: grid; place-items: center; font-size: 12.5px; flex: none; }
.step-row__body h4 { margin: 3px 0 3px; font-size: 13.5px; }
.step-row__body p { margin: 0; color: var(--muted); font-size: 12.5px; }
details.guide { border: 1px solid var(--stroke); border-radius: 14px; padding: 12px 16px; background: var(--panel); margin-bottom: 10px; box-shadow: var(--inset); }
details.guide summary { font-weight: 700; font-size: 13.5px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
details.guide[open] summary { margin-bottom: 10px; }
details.guide pre { background: var(--field); padding: 12px 14px; border-radius: 10px; font-family: var(--font-mono); font-size: 11.5px; overflow-x: auto; direction: ltr; text-align: left; box-shadow: var(--inset); }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--stroke); }
.set-row:last-child { border-bottom: 0; }
.set-row__t { font-weight: 700; font-size: 13px; }
.set-row__d { color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr)); gap: 12px; }
.stat-tile { padding: 16px; text-align: center; }
.stat-tile__n { font-size: 24px; font-weight: 800; color: var(--acc); direction: ltr; letter-spacing: -.5px; }
.stat-tile__l { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 2px; letter-spacing: .4px; text-transform: uppercase; }

/* accent palette picker */
.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr)); gap: 10px; }
.palette-card {
  border-radius: 13px; border: 1.5px solid var(--stroke); overflow: hidden;
  cursor: pointer; transition: all .25s var(--spring); background: var(--panel);
  position: relative; padding: 0;
}
.palette-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.palette-card.is-on { border-color: var(--acc-line); box-shadow: 0 0 0 3px var(--acc-soft); }
.palette-card__swatch { height: 44px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.palette-card__swatch i { width: 14px; height: 14px; border-radius: 5px; display: inline-block; }
.palette-card__name { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 7px 11px; font-size: 11.5px; font-weight: 700; color: var(--fg); border-top: 1px solid var(--stroke); }
.palette-card__name .tick { color: var(--acc); width: 13px; height: 13px; opacity: 0; transition: opacity .2s; }
.palette-card.is-on .tick { opacity: 1; }

/* ---------- auth/glass buttons on plain background ---------- */
.glass-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 13px;
  background: var(--panel); border: 1px solid var(--stroke);
  color: var(--muted); transition: all .25s var(--spring);
  box-shadow: var(--inset);
}
.glass-btn:hover { color: var(--fg); background: var(--panel-2); }
.glass-btn svg { width: 17px; height: 17px; }

/* ---------- responsive ---------- */
[data-mobile='menu'] { display: none; }

/* ---------- the global progress bar: a thin living line at the very top ---------- */
.loadbar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 400;
  pointer-events: none; opacity: 0; overflow: hidden;
  transition: opacity .25s var(--ease);
}
.loadbar.is-on { opacity: 1; }
.loadbar i {
  position: absolute; inset-block: 0; width: 38%; border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--acc) 45%, var(--acc-l, var(--acc)));
  box-shadow: 0 0 14px color-mix(in srgb, var(--acc) 65%, transparent);
  animation: loadslide 1.15s var(--ease) infinite;
}
@keyframes loadslide { from { inset-inline-start: -42%; } to { inset-inline-start: 106%; } }
.loadbar.is-done i { width: 100%; animation: none; opacity: 0; transition: opacity .4s; }

@media (max-width: 1120px) {
  .mail { grid-template-columns: 218px minmax(0, 1fr); }
  .email-row__from { width: 122px; }
}

@media (max-width: 900px) {
  .pillbar__nav { display: none; }
  .pillbar { gap: 4px; }
}

@media (max-width: 860px) {
  :root { --pill-h: 48px; --shell-top: 66px; }
  .pillbar { top: 10px; }
  .pillbar__name { display: none; }
  .pillbar__ver { display: none; }
  .pillbar__brand { padding-inline: 6px; }
  .tabbar { display: block; }
  .view { padding: var(--shell-top) 12px 92px; }
  .view--full { padding-bottom: 0 !important; height: calc(100vh - var(--shell-top) - 66px); height: calc(100svh - var(--shell-top) - 66px); }
  [data-mobile='menu'] { display: inline-flex; }

  .mail { grid-template-columns: minmax(0, 1fr); }
  .mail__sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(300px, 84vw); z-index: 95; display: none; border-radius: 0; border: 0; border-inline-end: 1px solid var(--stroke); transform: none; }
  .mail.show-sidebar .mail__sidebar { display: flex; }
  .mail.show-sidebar .mail__main { display: none; }
  .mail__ovalrow { gap: 6px; }
  .acct-oval { padding-block: 7px; padding-inline: 7px 12px; gap: 9px; min-width: 0; flex: 1; }
  .acct-oval__ava { width: 34px !important; height: 34px !important; font-size: 14px !important; }
  .acct-oval__name { max-width: 150px; font-size: 13px; }
  .acct-oval__addr { max-width: 200px; font-size: 10.5px; }
  .inbox-card { border-radius: 16px; }
  .email-row { padding: 10px 12px 10px 10px; gap: 9px; flex-wrap: wrap; row-gap: 2px; }
  .email-row .select-box { display: none; }
  .email-row.is-unread::before {
    content: ''; position: absolute; inset-inline-start: 3px; top: 16px; bottom: 16px;
    width: 3px; border-radius: 99px; background: var(--acc);
  }
  .email-row__ava { width: 31px; height: 31px; }
  .email-row__from { width: auto; flex: 1; min-width: 0; font-size: 12.8px; }
  /* two lines exactly: [face · sender · star · time] then [subject / snippet] */
  .email-row__end { order: 3; gap: 6px; }
  .email-row__mid { order: 4; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 1px; white-space: nowrap; }
  .email-row__subj { max-width: 100%; width: 100%; }
  .email-row__prev { width: 100%; }
  .email-row__sep { display: none; }
  .email-row__time { width: auto; min-width: 0; }
  .email-row__qa { display: none !important; }
  .viewer__actions .btn span { display: none; }
  .viewer__actions .btn { padding: 6px 8px; }
  .mtools { padding: 8px 14px 0; }
  .mail-frame-wrap { padding: 8px 10px 12px; }
  .mail-frame--narrow { width: 100%; }
  .note-panel { padding: 11px 14px 13px; }
  .attachments { padding: 9px 14px; }
  .viewer__head { padding: 13px 14px 11px; }
  .reader__card .viewer__head, .reader__card .mtools, .reader__card .mail-frame-wrap, .reader__card .attachments, .reader__card .note-panel { padding-inline: 14px; }
  .compose-fab { display: grid; }
  .toasts { inset-inline: 12px; bottom: calc(70px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  .auth-ctrls { top: 12px; inset-inline-end: 12px; }
  .page-title { font-size: 23px; }
  .reader__subj { font-size: 17px; }
}

@media (max-width: 480px) {
  .email-row { padding: 9.5px 11px 9.5px 9px; }
  .email-row__ava { width: 30px; height: 30px; border-radius: 10px; font-size: 12px; }
  .acct-oval__name { max-width: 118px; }
  .acct-oval__addr { max-width: 150px; }
  .modal { padding: 16px; }
  .stat-tile__n { font-size: 20px; }

  .gate__inline .field { min-width: 0; flex: 1 1 100%; }
}

button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--acc-soft), 0 0 0 1.5px var(--acc-line) !important;
  border-radius: 10px;
  transition: box-shadow .15s var(--ease);
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
  border-color: var(--acc-line);
  box-shadow: 0 0 0 3px var(--acc-soft) !important;
  border-radius: var(--radius-sm);
}
/* the palette field lives in a framed shell — no inner halo */
.cmdk input:focus-visible { box-shadow: none !important; border-color: transparent; border-radius: 0; }

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

/* ---------- utilities ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.mono { font-family: var(--font-mono); direction: ltr; unicode-bidi: embed; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; }
.hidden { display: none !important; }
.spin { animation: rot 1s linear infinite; display: inline-flex; }
@keyframes rot { to { transform: rotate(1turn); } }
.rot-180 { transform: rotate(180deg); }
.clickable { cursor: pointer; }
.ltr { direction: ltr; text-align: start; }
.hide-sm { display: inline-flex; }
@media (max-width: 860px) { .hide-sm { display: none !important; } }

/* ============================================================
   v1.4 — fine-glass polish · fluid responsive · cmdk · sheets
   ============================================================ */

/* ---------- global fine-glass refinements ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'liga' 1, 'kern' 1;
}
kbd.kbd, .kbd {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 6px;
  background: var(--field); border: 1px solid var(--field-line);
  border-bottom-width: 2px; color: var(--muted);
  direction: ltr; display: inline-block; line-height: 1.5;
}
/* tabular numbers everywhere digits align */
.email-row__time, .totp-code, .stat-tile__n, .ab-stat b, .ring__val,
.topbar__date, .badge, .addr-item__badge, .gate__auto {
  font-variant-numeric: tabular-nums;
}

/* ---------- buttons / controls: springy press ---------- */
.btn { letter-spacing: .1px; }
.btn:active { transform: scale(.96); }
.chip:active { transform: scale(.95); }
.icon-btn:active { transform: scale(.9); }
.nav-item:active { transform: scale(.985); }
button, a { -webkit-user-select: none; user-select: none; }


/* ---------- search pill in topbar ---------- */
.spot-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 8px 0 12px;
  border-radius: 999px;
  background: var(--field); border: 1px solid var(--field-line);
  color: var(--muted); font-size: 12.5px; font-weight: 600;
  transition: all .25s var(--ease);
  box-shadow: var(--inset);
}
.spot-pill:hover { color: var(--fg); border-color: var(--stroke-2); background: var(--panel-2); }
.spot-pill:active { transform: scale(.97); }
.spot-pill svg { width: 14px; height: 14px; }
.spot-pill .kbd { margin-inline-start: 2px; }
@media (max-width: 640px) {
  .spot-pill span.t { display: none; }
  .spot-pill .kbd { display: none; }
  .spot-pill { padding: 0 11px; }
}

/* ---------- command palette (⌘K) ---------- */
.cmdk-back {
  position: fixed; inset: 0; z-index: 230;
  background: color-mix(in srgb, var(--bg) 45%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  animation: fadeIn .22s var(--ease);
}
.cmdk {
  position: absolute; left: 50%; top: clamp(64px, 14vh, 160px);
  transform: translateX(-50%);
  width: min(620px, 92vw);
  border-radius: 22px;
  overflow: hidden;
  background: var(--panel-2);
  backdrop-filter: blur(34px) saturate(1.7);
  -webkit-backdrop-filter: blur(34px) saturate(1.7);
  border: 1px solid var(--stroke);
  box-shadow: 0 40px 90px -24px rgba(0, 0, 0, .55), var(--inset);
  animation: cmdkIn .42s var(--spring);
  transform-origin: top center;
}
@keyframes cmdkIn { from { opacity: 0; transform: translateX(-50%) scale(.94) translateY(-12px); } to { opacity: 1; transform: translateX(-50%) scale(1) translateY(0); } }
.cmdk__in { display: flex; align-items: center; gap: 11px; padding: 5px 16px; border-bottom: 1px solid var(--stroke); }
.cmdk__in > .icn { color: var(--acc); flex: none; }
.cmdk__in > .icn svg { width: 19px; height: 19px; }
.cmdk input {
  flex: 1; min-width: 0; background: none; border: 0; outline: none;
  font: inherit; font-size: 16.5px; font-weight: 500; color: var(--fg);
  padding: 13px 0;
}
.cmdk input::placeholder { color: var(--faint); }
.cmdk__esc {
  font-size: 10.5px; font-weight: 700; color: var(--muted);
  background: var(--field); border: 1px solid var(--field-line);
  border-radius: 7px; padding: 3px 9px; flex: none;
}
.cmdk__list { max-height: min(48vh, 430px); overflow-y: auto; padding: 9px; overscroll-behavior: contain; }
.cmdk__group {
  font-size: 10px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--faint); padding: 9px 12px 5px;
}
.cmdk__item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9.5px 12px; border-radius: 13px;
  font-size: 13.5px; font-weight: 600; color: var(--fg);
  text-align: start; transition: background .15s var(--ease);
}
.cmdk__item > .icn { color: var(--muted); flex: none; display: inline-flex; }
.cmdk__item > .icn svg { width: 17px; height: 17px; }
.cmdk__item.is-active { background: var(--acc-soft); }
.cmdk__item.is-active > .icn { color: var(--acc); }
.cmdk__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk__sub {
  font-size: 11px; color: var(--muted); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46%;
}
.cmdk__enter {
  display: inline-flex; color: var(--acc); flex: none;
  animation: pop .25s var(--spring);
}
.cmdk__enter svg { width: 14px; height: 14px; }
html[dir='rtl'] .cmdk__enter svg { transform: scaleX(-1); }
.cmdk__none { display: grid; place-items: center; gap: 8px; padding: 38px 16px; color: var(--muted); font-size: 13px; font-weight: 600; }
.cmdk__none svg { width: 30px; height: 30px; opacity: .5; }
.cmdk__sw { width: 17px; height: 17px; border-radius: 50%; flex: none; border: 1px solid rgba(255, 255, 255, .25); }
.cmdk__sw--green { background: #aed890; } .cmdk__sw--blue { background: #8cc8de; }
.cmdk__sw--purple { background: #c2a7e2; } .cmdk__sw--amber { background: #eec27e; }
.cmdk__sw--sage { background: #aed890; } .cmdk__sw--violet { background: #c2a7e2; }
.cmdk__sw--rose { background: #f2a6ba; }
.cmdk__sw--emerald { background: #86dcab; } .cmdk__sw--ocean { background: #82c8ea; }
.cmdk__sw--midnight { background: #9fadea; } .cmdk__sw--sakura { background: #f2bcd9; }
.cmdk__sw--gold { background: #ecd27e; } .cmdk__sw--coral { background: #f2a58f; }
.cmdk__sw--ice { background: #bce2ea; } .cmdk__sw--wine { background: #e2a3b2; }
.cmdk__foot {
  display: flex; align-items: center; gap: 18px;
  padding: 9px 16px; border-top: 1px solid var(--stroke);
  font-size: 11px; color: var(--faint); font-weight: 600;
  background: color-mix(in srgb, var(--panel) 60%, transparent);
}
.cmdk__foot .kbd { margin-inline-end: 5px; }
/* v3.0.0 — the nav hint's arrows are SVG chevrons now: text arrows (↑↓)
   were exactly the glyphs several device fonts render as tofu boxes */
.cmdk__navhint { display: inline-flex; align-items: center; gap: 3px; }
.cmdk__navhint .kbd { margin-inline-end: 5px; }
.kbd--icn { display: inline-grid; place-items: center; padding: 2px 4px; }
.kbd--icn .icn { display: inline-flex; }
.kbd--icn svg { width: 11px; height: 11px; display: block; }
.icn.flip-v { transform: rotate(180deg); }

/* ---------- toasts: island style ---------- */
.toast {
  border-radius: 16px;
  padding: 10px 16px;
  backdrop-filter: blur(26px) saturate(1.6);
  -webkit-backdrop-filter: blur(26px) saturate(1.6);
  box-shadow: 0 22px 48px -16px rgba(0, 0, 0, .5), var(--inset);
  font-variant-numeric: tabular-nums;
}

/* ---------- modal → bottom sheet on mobile ---------- */
.modal__grab { display: none; }
@media (max-width: 860px) {
  .modal-back { padding: 0; align-items: flex-end; }
  .modal.modal--sheet, .modal {
    width: 100%; max-height: 93dvh;
    border-radius: 24px 24px 0 0; border-bottom: 0;
    border-inline: 0;
    animation: sheetUp .5s var(--ease);
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
  .modal__grab {
    display: block; width: 42px; height: 5px; border-radius: 99px;
    background: var(--stroke-2); margin: 0 auto 10px;
  }
  @keyframes sheetUp { from { transform: translateY(55%); opacity: .4; } to { transform: none; opacity: 1; } }
}

/* ---------- email row: hover quick actions ---------- */
.email-row__qa {
  position: absolute; top: 50%; transform: translateY(-50%); inset-inline-end: 10px;
  display: none; gap: 2px;
  padding: 2.5px; border-radius: 999px;
  background: var(--panel-2);
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-soft);
  z-index: 2;
}
@keyframes qaPop { from { opacity: 0; transform: translateY(-50%) scale(.85); } to { opacity: 1; transform: translateY(-50%) scale(1); } }
@media (hover: hover) {
  .email-row:hover .email-row__qa { display: flex; animation: qaPop .24s var(--spring); }
}
/* keyboard users: quick actions ride along with the cursor row */
.email-row.is-cursor .email-row__qa { display: flex; animation: qaPop .24s var(--spring); }
.email-row.is-selected .email-row__qa, .email-row.is-active .email-row__qa { display: none; }
.email-row__qa button {
  width: 27px; height: 27px; border-radius: 50%;
  display: grid; place-items: center; color: var(--muted);
  transition: all .2s var(--spring);
}
.email-row__qa button:hover { background: var(--hover); color: var(--fg); transform: scale(1.08); }
.email-row__qa button:active { transform: scale(.9); }
.email-row__qa button:last-child:hover { color: var(--danger); }
.email-row__qa svg { width: 14px; height: 14px; }

/* unread badge pop */
.badge.pop { animation: badgePop .5s var(--spring); }
@keyframes badgePop { 0% { transform: scale(.4); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ---------- auth shake ---------- */
.shake { animation: shakeX .55s var(--ease); }
@keyframes shakeX {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

/* ---------- confetti ---------- */
/* celebration pieces fall BEHIND the app, never on it: the app shell and the
   chrome all own higher stacking floors, so confetti shows only on the
   background and faintly through the glass — it used to rain on top of the
   status pills, titles and buttons (users saw it as broken elements) */
.confetti { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
main#app { position: relative; z-index: 2; }
.confetti i {
  position: absolute; top: -16px;
  animation: confFall linear forwards;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}
@keyframes confFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(108vh) rotate(680deg); opacity: 0; }
}

/* ---------- about: tilt + counters ---------- */
.ab-card.tilt, .ab-logo { transition: box-shadow .3s; transform-style: preserve-3d; will-change: transform; }
.ab-card.tilt:hover { box-shadow: var(--shadow); }
.ab-stat b { direction: ltr; }

/* ---------- help: keyboard shortcuts card ---------- */
.kb-card { margin-bottom: 14px; }
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 8px 18px; }
.kb-row { display: flex; align-items: center; gap: 10px; padding: 6.5px 0; }
.kb-keys { display: inline-flex; gap: 4px; flex: none; }
.kb-lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ============================================================
   FLUID RESPONSIVE — 320px → 1920px · touch-first (HIG 44pt)
   ============================================================ */

/* large desktop ≥ 1600: a bit more air */
@media (min-width: 1600px) {
  .mail { gap: 16px; }
}

/* laptop ≤ 1280 (desktop range only — never fight the mobile layout).
   the old three-track template here was a leftover of the retired reading
   pane — it squeezed the list to a sliver and left a dead column of air on
   common 1025–1280 laptops ("the jump on some devices") */
@media (max-width: 1280px) and (min-width: 861px) {
  .mail { grid-template-columns: 224px minmax(0, 1fr); gap: 12px; }
}

/* small desktop / landscape tablet ≤ 1024 */
@media (max-width: 1024px) {
  .mail__sidebar { padding: 12px 9px 10px; }
}

/* touch devices: bigger targets (≥ 44px) + iOS refuses to auto-zoom inputs
   sized ≥ 16px — the zoom-on-focus was another reported "jump" on iPhones */
@media (hover: none) {
  .input, textarea.input, select.input { font-size: 16px; }
  .icon-btn { width: 42px; height: 42px; }
  .btn { padding: 10px 18px; min-height: 40px; }
  .btn--sm { padding: 8px 14px; min-height: 36px; }
  .chip { padding: 8px 13px; }
  .seg button { padding: 8px 14px; }
  .filters .chip { padding: 7px 12px; }
  .email-row { padding: 12px 12px; }
  .select-box { width: 22px; height: 22px; margin-top: 2px; }
  .tab svg { width: 21px; height: 21px; }
  .mail__search { padding: 10px 14px !important; }
  .input { padding: 11px 13px; }
  .addr-item { padding: 11px 12px; }
  .glass-btn { width: 42px; height: 42px; }
  .viewer__actions .btn { min-height: 34px; }
}

/* phone landscape: compact chrome */
@media (max-height: 480px) and (orientation: landscape) {
  .tabbar__in { height: 46px; }
  .tabbar { height: calc(46px + env(safe-area-inset-bottom)); }
  .compose-fab { width: 44px; height: 44px; bottom: calc(58px + env(safe-area-inset-bottom)); }
  .auth-logo { width: 64px; }
  .ab-hero { padding: 16px; }
}

/* ≤ 640: tighter cards + page-head */
@media (max-width: 640px) {
  .page-head { margin-bottom: 10px; }
  .page-title { font-size: clamp(21px, 6vw, 24px); }
  .card { padding: 13px; }
  .auth-card { padding: 18px 16px 16px; }
  .settings-grid, .stat-tiles { gap: 10px; }
  .vault-grid { grid-template-columns: 1fr; gap: 10px; }
  .totp-code { font-size: 20px; letter-spacing: 2px; }
  .ab-grid__in { grid-template-columns: 1fr 1fr; gap: 9px; }
  .ab-stats { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .dns-table th, .dns-table td { padding: 7px 8px; font-size: 11.5px; }

  .cmdk { width: min(620px, 94vw); }
  .cmdk__sub { display: none; }
  .modal--wide { width: 100%; }
}

/* ≤ 480: compact everything */
@media (max-width: 480px) {
  /* mailbox rows: nothing ever collides — fixed slots, truncating names */
  .email-row { gap: 9px; padding: 10px 9px; }
  .email-row__end { gap: 2px; }
  .email-row__time { font-size: 9.5px; }
  .email-row__star, .email-row__kebab { width: 26px; height: 26px; }
  .email-row__kebab svg { width: 14px; height: 14px; }
  .ab-grid__in { grid-template-columns: 1fr; }
  .kb-grid { grid-template-columns: 1fr; gap: 2px; }
  .kb-row { padding: 8px 0; border-bottom: 1px solid var(--stroke); }
  .kb-row:last-child { border-bottom: 0; }
  .gate__title { font-size: 22px; }
  .ab-title { font-size: 25px; }
  .stat-tile__n { font-size: 19px; }
  .filters { gap: 5px; }
  .filters .chip { font-size: 11px; }
  .toasts { inset-inline: 10px; }
  .mail__sidebar { width: min(280px, 86vw); }
}

/* ≤ 360: last-resort compactness */
@media (max-width: 360px) {
  .email-row__ava { width: 28px; height: 28px; font-size: 11.5px; border-radius: 9px; }
  .btn { padding: 9px 13px; font-size: 12.5px; }
  .compose-fab { width: 48px; height: 48px; inset-inline-end: 12px; }
  .viewer__subj { font-size: 15px; }
  /* wizard rail: labels never collide with the modal edge on tiny phones */
  .wiz__st-t { max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .gate__top { flex-wrap: wrap; }
  .check__pill { font-size: 10px; padding: 3px 8px; }
}

/* very tall phones: keep FAB reachable, lists breathe */
/* safe-area padding for floating chrome */
.sidebar__user { margin-bottom: 0; }
@supports (padding: env(safe-area-inset-bottom)) {
  @media (max-width: 860px) {
    .view--auth { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  }
}

/* accessibility: honour reduced motion for new effects too */
@media (prefers-reduced-motion: reduce) {
  .confetti { display: none; }
  .email-row.is-new { animation: none; }
  .ab-card.tilt, .ab-logo { transform: none !important; }
}

/* ============================================================
   v1.6 — account-style mailboxes · glyph logos · alive themes
   ============================================================ */

/* ---------- shared bits ---------- */
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--acc); display: inline-block; flex: none; }
pre { overflow-x: auto; direction: ltr; text-align: left; max-width: 100%; }

/* ---------- glyph tiles + picker ---------- */
.glyph-tile {
  --gc: var(--acc);
  width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center; flex: none;
  color: #fff; font-weight: 800;
  background: linear-gradient(140deg, color-mix(in srgb, var(--gc) 82%, #ffffff 4%), color-mix(in srgb, var(--gc) 70%, #000 14%));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 5px 14px -5px color-mix(in srgb, var(--gc) 60%, transparent);
}
.glyph-tile__mark { width: 19px; height: 19px; display: inline-flex; }
.glyph-tile__mark svg { width: 100%; height: 100%; }
.glyph-tile__letter { font-size: 14px; }

.glyph-picker-wrap { display: none; margin: 2px 0 10px; }
.glyph-picker-wrap.is-open { display: block; animation: fadeIn .25s var(--ease); }
.glyph-picker__tabs { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 8px; }
.glyph-picker__tabs .chip { padding: 4px 11px; font-size: 11.5px; }
.glyph-picker__grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46px, 100%), 1fr)); gap: 6px;
  max-height: 230px; overflow-y: auto; padding: 3px;
}
.glyph-picker__cat {
  grid-column: 1/-1; font-size: 10px; font-weight: 800; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--faint); padding: 7px 2px 1px;
}
.glyph-cell {
  aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center;
  background: var(--field); border: 1px solid var(--field-line); color: var(--muted);
  transition: all .2s var(--spring);
}
.glyph-cell:hover { color: var(--fg); border-color: var(--stroke-2); transform: translateY(-2px); }
.glyph-cell.is-on { border-color: var(--acc-line); background: var(--acc-soft); color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.glyph-cell__mark { width: 22px; height: 22px; display: inline-flex; }
.glyph-cell__mark svg { width: 100%; height: 100%; }

/* ---------- mail sidebar: accounts ---------- */
.mail__scrim { display: none; }
.addr-item { cursor: pointer; }
.addr-item__ava { width: 30px; height: 30px; border-radius: 10px; font-size: 12.5px; margin-top: 0; }
.addr-item__info { width: 26px; height: 26px; flex: none; opacity: 0; transition: opacity .2s; }
.addr-item:hover .addr-item__info, .addr-item.is-on .addr-item__info { opacity: .8; }
.addr-item__info svg { width: 14px; height: 14px; }
@media (hover: none) { .addr-item__info { opacity: .55; width: 36px; height: 36px; } }
.addr-add {
  display: flex; align-items: center; gap: 10px; width: 100%;
  margin-top: 6px; padding: 10px 12px; border-radius: 12px;
  border: 1.5px dashed var(--stroke-2); color: var(--muted);
  font-size: 12.5px; font-weight: 700; transition: all .2s var(--ease);
  text-align: start;
}
.addr-add:hover { color: var(--acc); border-color: var(--acc-line); background: var(--acc-soft); }
.addr-add__plus { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--acc-soft); color: var(--acc); flex: none; }
.addr-add__plus svg { width: 13px; height: 13px; }
@media (max-width: 860px) {
  .mail__scrim {
    position: fixed; inset: 0; z-index: 64; display: none;
    background: var(--scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  }
  .mail.show-sidebar .mail__scrim { display: block; animation: fadeIn .25s var(--ease); }
}

/* ---------- email rows: star slot + selection mode ---------- */
.email-row__end { display: inline-flex; align-items: center; gap: 4px; flex: none; }
/* ---------- note panel: collapsible on phones ---------- */
.note-panel__head {
  width: 100%; text-align: start; background: none;
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--muted);
}
button.note-panel__head { cursor: pointer; }
.note-panel__chev { display: inline-flex; margin-inline-start: auto; transition: transform .3s var(--ease); }
.note-panel__chev svg { width: 14px; height: 14px; }
.note-panel.is-open .note-panel__chev { transform: rotate(180deg); }
.note-panel__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--acc); display: inline-block; flex: none; }
.note-panel__in { display: none; flex-direction: column; gap: 8px; margin-top: 0; }
.note-panel.is-open .note-panel__in { display: flex; animation: fadeIn .25s var(--ease); }
.note-panel .note-panel__in textarea { resize: vertical; min-height: 64px; }
@media (min-width: 861px) {
  .note-panel__in { margin-top: 8px; }
}
@media (max-width: 860px) {
  .note-panel__head { padding: 2px 0; }
  .note-panel.has-note:not(.is-open) .note-panel__head { color: var(--fg); }
  .note-panel { padding: 11px 14px 12px; }
}

/* viewer: never let the chrome starve the body on short screens */
@media (max-height: 780px) {
  .viewer__head { padding: 12px 20px 10px; }
  .viewer__subj { font-size: 15px; margin-bottom: 8px; }
  .mtools { padding-top: 7px; }
  .note-panel .note-panel__in textarea { min-height: 46px; }
}
@media (max-height: 620px) {
  .viewer-back { display: none; }
  .viewer__head .viewer__actions .btn .hide-sm { display: none !important; }
}

/* ---------- account modal ---------- */
.acct-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--field); border: 1px solid var(--field-line); margin-bottom: 12px;
}
.acct-head__addr {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 13.5px; cursor: pointer;
  direction: ltr; justify-content: flex-start; text-align: left;
}
.acct-head__addr .icn { color: var(--faint); width: 14px; height: 14px; }
.acct-head__addr:hover .icn { color: var(--acc); }
.acct-notes { resize: vertical; min-height: 92px; font-size: 13px; line-height: 1.85; }
.acct-2fa { margin-top: 4px; }
.acct-2fa__head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin-bottom: 9px; }
.acct-2fa__head svg { width: 15px; height: 15px; color: var(--acc); }
.acct-2fa__head .btn { margin-inline-start: auto; }
.acct-totps { display: flex; flex-direction: column; gap: 6px; }
.acct-totps__empty {
  display: flex; gap: 9px; align-items: center; color: var(--muted);
  font-size: 12px; line-height: 1.7; padding: 12px 14px; border-radius: 12px;
  background: var(--field); border: 1px dashed var(--stroke-2);
}
.acct-totps__empty svg { width: 16px; height: 16px; flex: none; }
.acct-totp {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px; border-radius: 12px;
  background: var(--field); border: 1px solid var(--field-line);
}
.acct-totp__name { font-size: 12.5px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-totp__code { font-size: 14px; font-weight: 700; letter-spacing: 1.5px; direction: ltr; }
.acct-totp .icon-btn { width: 26px; height: 26px; }

/* ---------- vault: account filters + linked chip ---------- */
.vault-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.vault-filters .chip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vault-filters .chip svg { width: 12.5px; height: 12.5px; }
.vault-filters--folders { padding-top: 2px; }
.vault-filters--folders .chip .faint { font-size: 10px; }

/* folder manager */
.fld-list { display: flex; flex-direction: column; gap: 8px; max-height: 46dvh; overflow: auto; padding: 2px; }
.fld-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 13px;
  background: var(--field); border: 1px solid var(--field-line);
}
.fld-ico {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center; padding: 0;
  background: var(--panel-3); border: 1px dashed var(--stroke-2);
  cursor: pointer; transition: border-color .2s;
}
.fld-ico:hover { border-color: var(--acc-line); }
.fld-ico .glyph-tile { width: 30px; height: 30px; }
.fld-ico .glyph-tile svg { width: 15px; height: 15px; }
.fld-ico .glyph-tile__letter { font-size: 12px; }
.fld-new { border-top: 1px solid var(--stroke); padding-top: 12px; margin-top: 4px; }
.fld-new .glyph-tile { width: 34px; height: 34px; flex: none; }
.totp-card__acc {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; color: var(--muted);
  padding: 3px 11px; margin-bottom: 9px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--field); border: 1px solid var(--field-line); border-radius: 99px;
  text-align: start; direction: ltr;
}
.totp-card__acc:hover { color: var(--fg); border-color: var(--stroke-2); }

/* ---------- login: recovery help on the page itself ---------- */
.auth-help {
  margin-top: 14px; border: 1px solid var(--stroke); border-radius: 13px;
  background: var(--field); overflow: hidden;
}
.auth-help summary {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 13px; font-size: 12.5px; font-weight: 700;
  color: var(--muted); cursor: pointer; list-style: none;
  transition: color .2s;
}
.auth-help summary::-webkit-details-marker { display: none; }
.auth-help summary:hover { color: var(--fg); }
.auth-help summary svg { width: 15px; height: 15px; color: var(--acc); flex: none; }
.auth-help .rec-body { padding: 2px 13px 13px; display: flex; flex-direction: column; gap: 9px; border-top: 1px solid var(--stroke); }
.rec-lead { margin: 8px 0 0; line-height: 1.85; }
@media (max-width: 480px) and (min-height: 560px) {
  .rec-body { max-height: none !important; }
}
@media (max-width: 480px) {
  .step-row { gap: 10px; }
  .step-row__num { width: 26px; height: 26px; border-radius: 9px; font-size: 11.5px; }
  .guide summary { padding: 10px 12px; font-size: 12.5px; }
}
.rec-body .step-row { padding: 4px 0; }
.rec-body .step-row__body h4 { font-size: 12.5px; font-weight: 700; margin: 0; line-height: 1.7; }
.rec-warn {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 9px 11px; border-radius: 10px;
  background: color-mix(in srgb, var(--warn) 13%, transparent);
  color: var(--warn); font-size: 11px; font-weight: 600; line-height: 1.75;
}
.rec-warn svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }

/* ---------- about: cleaner cards, RTL-safe stats ---------- */
.ab-card__row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.ab-card .ab-card__row h3 { margin: 0; }
.ab-stat__txt { min-width: 0; display: flex; flex-direction: column; }
.ab-stat b.ab-stat__v { direction: auto; unicode-bidi: plaintext; text-align: start; font-size: 16.5px; }
.ab-stat .ab-stat__l { font-size: 10.5px; color: var(--muted); display: block; }
@media (max-width: 860px) {
  .ab-creator { flex-direction: column; text-align: center; align-items: center; }
  .ab-creator__id { justify-content: center; }
  .ab-creator__links { justify-content: center; }
}
@media (max-width: 640px) {
  .ab-grid__in { grid-template-columns: 1fr 1fr; }
  .ab-card { padding: 13px; }
  .ab-card p { font-size: 11.5px; line-height: 1.75; }
  .ab-hero { padding: 22px 14px 18px; }
  .ab-hero__links .btn { padding: 9px 14px; font-size: 12.5px; }
  .ab-made { font-size: 11px; }
}
@media (max-width: 420px) {
  .ab-grid__in { grid-template-columns: 1fr; }
  .ab-stats { grid-template-columns: 1fr 1fr; }
  .ab-hero__meta .chip { max-width: 100%; }
}

/* ---------- help: phone-proof ---------- */
@media (max-width: 640px) {
  .view pre { font-size: 11px; padding: 10px 12px; border-radius: 10px; }
  .step-row { gap: 10px; padding: 10px 0; }
  .step-row__num { width: 26px; height: 26px; font-size: 11.5px; }
  .step-row__body h4 { font-size: 13px; line-height: 1.7; }
  .kb-grid { grid-template-columns: 1fr; }
  .copy-line { flex-wrap: wrap; }
  .copy-line span { font-size: 11px; }
  .copy-line .btn { margin-inline-start: auto; }
}

/* copy lines: long SQL scrolls instead of clipping */
.copy-line { gap: 6px; }
.copy-line span { flex: 1; min-width: 0; overflow-x: auto; white-space: pre; scrollbar-width: thin; padding-bottom: 2px; }

/* ============================================================
   v1.9 — domain health chips · row action sheet · richer mood grid
   ============================================================ */

/* ---------- domain setup health ---------- */
.dom-st {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; padding: 3px 10px;
  border-radius: 99px; border: 1px solid var(--stroke);
  color: var(--muted); white-space: nowrap; max-width: 100%;
}
.dom-st i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.dom-st--ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 32%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.dom-st--warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 32%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.dom-st--off { color: var(--faint); }
@media (max-width: 640px) {
  .tbl { min-width: 0; }
  .dom-st { padding: 2.5px 8px; font-size: 10.5px; }
  .dom-st .faint { display: none; }
}

/* ---------- per-row action sheet (⋮ menu) ---------- */
.menu-stack { display: flex; flex-direction: column; gap: 8px; }
.menu-act {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 12px 14px; border-radius: 13px;
  background: var(--field); border: 1px solid var(--field-line);
  font-weight: 700; font-size: 13px; text-align: start;
  transition: all .2s var(--ease);
}
.menu-act svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.menu-act:hover { border-color: var(--stroke-2); background: var(--hover); }
.menu-act:active { transform: scale(.985); }
.menu-act.btn--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.menu-act.btn--danger svg { color: var(--danger); }

/* ---------- richer palette grid (13 moods) ---------- */
.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(128px, 100%), 1fr)); gap: 9px; }
.palette-grid--4 { grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr)); gap: 12px; }
.palette-grid--4 .palette-card { padding: 13px; border-radius: 16px; }
.palette-card { padding: 10px 8px 9px; }

/* ============================================================
   v2.2 — domain connect wizard · D1 inspector · optional-send
   ============================================================ */

/* lifecycle chips for domains */
.dom-st--draft { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 32%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.dom-st--verify { color: #7aa7d8; border-color: color-mix(in srgb, #7aa7d8 32%, transparent); background: color-mix(in srgb, #7aa7d8 10%, transparent); }
.dom-st--unv { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 32%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.dom-st--wait { color: #7aa7d8; border-color: color-mix(in srgb, #7aa7d8 32%, transparent); background: color-mix(in srgb, #7aa7d8 10%, transparent); }

/* the gate's own domain list: every saved domain keeps its seat here —
   drafts and verifying ones with a continue button, so no one retypes a
   domain just to reach its wizard again */
.gate__doms { display: none; margin-top: 10px; }
.gate__doms.has-rows { display: block; }
.gate__dom {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border: 1px solid var(--stroke); border-radius: 12px;
  background: var(--panel); margin-bottom: 7px;
}
.gate__dom code { font-size: 12.5px; font-weight: 600; }
.gate__dom .btn { margin-inline-start: auto; }
.dom-st--draft svg, .dom-st--verify svg, .dom-st--unv svg { width: 12px; height: 12px; }
.dom-row--wip td { background: color-mix(in srgb, var(--warn) 4%, transparent); }
.dom-row--wip .mono { position: relative; }

/* small "optional" tag next to a check title / inside a panel */
.chip-opt {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .2px;
  color: var(--faint); border: 1px dashed var(--stroke);
  padding: 2px 8px; border-radius: 99px; vertical-align: 2px; white-space: nowrap;
}
.chip-opt svg { width: 11px; height: 11px; }
.check__txt .chip-opt { margin-inline-start: 2px; }

/* ghost danger button (drop-extra-table) */
.btn--danger-ghost { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); background: color-mix(in srgb, var(--danger) 6%, transparent); }
.btn--danger-ghost svg { color: var(--danger); }

/* ---------- D1 inspector ---------- */
.d1 { margin-top: 12px; display: flex; flex-direction: column; gap: 9px; }
.d1__load { font-size: 12.5px; color: var(--faint); padding: 6px 2px; }
.d1__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.d1__head > b { font-size: 13px; }
.d1__grid { display: flex; flex-direction: column; gap: 4px; }
.d1__row {
  display: flex; align-items: center; gap: 6px 9px; flex-wrap: wrap;
  padding: 6px 10px; border-radius: 10px;
  border: 1px solid var(--stroke); background: var(--field);
  font-size: 12.5px;
}
.d1__row .btn { margin-inline-start: auto; }
.d1__row.is-miss { border-style: dashed; opacity: .92; }
.d1__row.is-extra { border-color: color-mix(in srgb, var(--danger) 24%, transparent); }
.d1__icn { display: inline-flex; color: var(--ok); flex: none; }
.d1__row.is-miss .d1__icn { color: var(--faint); }
.d1__row.is-extra .d1__icn { color: var(--faint); }
.d1__icn svg { width: 13px; height: 13px; }
.d1__name { font-family: var(--mono, ui-monospace, monospace); font-size: 12px; font-weight: 600; letter-spacing: .2px; min-width: 0; overflow-wrap: anywhere; }
.d1__rows { margin-inline-start: auto; font-size: 11px; color: var(--faint); white-space: nowrap; }
.d1__extras { display: flex; flex-direction: column; gap: 4px; }
.d1__extra-t { font-size: 11px; font-weight: 700; color: var(--warn); margin-top: 2px; }
/* the per-row build/drop buttons: on phones the label folds away and the
   glyph carries the action (title + aria-label keep it accessible), so every
   table row is ONE tidy line at any width — the full label returns the
   moment the card has room. Before this, the button wrapped onto its own
   ragged line on 320px phones and the row read as scattered symbols. */
@media (max-width: 420px) {
  .d1__row { row-gap: 6px; flex-wrap: nowrap; }
  .d1__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .d1__row .btn { padding: 5px 8px; font-size: 11px; gap: 4px; }
  .d1__row .d1__add-t { display: none; }
  .d1__rows { font-size: 10.5px; }
}

/* ---------- domain connect wizard ---------- */
.wiz__rail { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; }
.wiz__st { display: inline-flex; align-items: center; gap: 7px; color: var(--faint); font-size: 12px; font-weight: 700; }
.wiz__st-n {
  width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--stroke); font-size: 11.5px; background: var(--field); flex: none;
}
.wiz__st.is-on { color: var(--text); }
.wiz__st.is-on .wiz__st-n { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.wiz__st.is-done { color: var(--ok); }
.wiz__st.is-done .wiz__st-n { border-color: var(--ok); color: var(--ok); }
.wiz__st-n svg { width: 12px; height: 12px; }
.wiz__rail-l { flex: 1; height: 1.5px; background: var(--stroke); border-radius: 2px; }

.wiz__lead { font-size: 13.5px; color: var(--muted); line-height: 1.9; margin-bottom: 12px; }
.wiz__lead b { color: var(--text); font-weight: 700; }

.wiz__guide { display: flex; flex-direction: column; gap: 8px; }
.wiz__gstep {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--stroke); background: color-mix(in srgb, var(--field) 70%, transparent);
}
.wiz__gicn {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.wiz__gicn svg { width: 15px; height: 15px; }
.wiz__gtxt { flex: 1; min-width: 0; }
.wiz__gtxt p { font-size: 13px; line-height: 1.9; color: var(--text); }
.wiz__dns { margin-top: 4px; }

.wiz__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.wiz__foot--c { justify-content: center; }
.wiz__skip { margin-inline-start: auto; }

.wiz__code {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  margin-bottom: 10px;
}
.wiz__code code { font-size: 15px; font-weight: 700; letter-spacing: .4px; word-break: break-all; }

.wiz__howto { font-size: 12.5px; line-height: 1.95; color: var(--muted); }

.wiz__live { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.wiz__pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.wiz__pulse.is-on { background: var(--ok); animation: wizPulse 1.6s ease-in-out infinite; }
.wiz__pulse.is-bad { background: var(--warn); animation: none; }
@keyframes wizPulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent); }
  55% { box-shadow: 0 0 0 7px transparent; }
}
.wiz__exp { font-variant-numeric: tabular-nums; color: var(--faint); font-size: 11.5px; }

.wiz__resume {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px; padding: 9px 12px; border-radius: 11px;
  border: 1px dashed color-mix(in srgb, var(--warn) 40%, transparent);
  background: color-mix(in srgb, var(--warn) 8%, transparent);
  font-size: 12.5px; font-weight: 600; color: var(--text);
}
.wiz__resume svg { width: 14px; height: 14px; color: var(--warn); flex: none; }

.wiz__done { text-align: center; padding: 14px 4px 4px; }
.wiz__done-icn {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ok); border: 2px solid color-mix(in srgb, var(--ok) 40%, transparent);
  background: color-mix(in srgb, var(--ok) 10%, transparent);
  animation: wizPop .5s cubic-bezier(.2, 1.4, .4, 1);
}
.wiz__done-icn.is-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.wiz__done-icn svg { width: 28px; height: 28px; }
@keyframes wizPop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.wiz__done h3 { font-size: 17px; margin-bottom: 8px; }
.wiz__done p { font-size: 13px; color: var(--muted); line-height: 1.9; max-width: 420px; margin: 0 auto; }
.wiz__done .wiz__foot { justify-content: center; margin-top: 18px; }

.wiz__exit-d, .wiz__warn-d { font-size: 13px; line-height: 2; color: var(--text); }
.wiz__warn-d { color: var(--warn); font-weight: 600; }

@media (max-width: 640px) {
  .wiz__rail { gap: 6px; }
  .wiz__st-t { font-size: 11px; }
  .wiz__gstep { padding: 9px 10px; }
  .wiz__skip { margin-inline-start: 0; }
  .wiz__code code { font-size: 13px; }
}

/* ---------- 2.3 · system alerts (top-of-page banners) ---------- */
.sysalert-wrap {
  display: flex; flex-direction: column; gap: 8px;
  max-width: 1240px; margin: var(--shell-top) auto 0; padding: 0 20px; width: 100%;
  position: relative; z-index: 85;
}
/* v3.2.2 — the display:flex above overrode the [hidden] attribute (author CSS
   beats the UA rule), and an "empty" wrap still carried its margins. Now the
   hidden state is real, and the app layout reads the banners' measured height
   from --alert-h (set by health.js syncAlertChrome) — no more magic 150px that
   broke the moment a banner was dismissed or wrapped to more lines. */
.sysalert-wrap[hidden] { display: none; }
@media (max-width: 860px) { .sysalert-wrap { padding: 0 12px; margin-top: calc(var(--shell-top) + 2px); } }
.alert-card {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 14px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  animation: alert-in .35s var(--ease) both;
}
@keyframes alert-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.alert-card--err { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger) 7%, var(--panel)); }
.alert-card--warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 7%, var(--panel)); }
.alert-card__pulse {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--danger); position: relative;
}
.alert-card--warn .alert-card__pulse { background: var(--warn); }
.alert-card__pulse::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid currentColor; color: inherit; opacity: 0;
  animation: alert-ping 1.8s ease-out infinite;
}
.alert-card--err .alert-card__pulse::after { border-color: var(--danger); }
.alert-card--warn .alert-card__pulse::after { border-color: var(--warn); }
@keyframes alert-ping { 0% { transform: scale(.5); opacity: .8; } 80%, 100% { transform: scale(1.6); opacity: 0; } }
.alert-card__body { min-width: 0; flex: 1; }
.alert-card__t { font-size: 13px; font-weight: 800; }
.alert-card__d { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.7; }
.alert-card__acts { display: flex; align-items: center; gap: 6px; flex: none; }
.alert-card__x { width: 28px; height: 28px; opacity: .6; }
@media (max-width: 760px) {
  .alert-card { flex-wrap: wrap; }
  .alert-card__acts { width: 100%; justify-content: flex-end; }
}

/* ---------- 2.3 · health pane (settings) ---------- */
.health { display: flex; flex-direction: column; gap: 14px; }
.health__hero {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px;
  border-radius: 18px; position: relative; overflow: hidden;
}
.health__hero--ok { border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.health__hero--warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.health__hero--err { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.health__hero--ok::before, .health__hero--warn::before, .health__hero--err::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
}
.health__hero--ok::before { background: radial-gradient(420px 160px at 12% 0%, color-mix(in srgb, var(--ok) 12%, transparent), transparent 70%); }
.health__hero--warn::before { background: radial-gradient(420px 160px at 12% 0%, color-mix(in srgb, var(--warn) 14%, transparent), transparent 70%); }
.health__hero--err::before { background: radial-gradient(420px 160px at 12% 0%, color-mix(in srgb, var(--danger) 12%, transparent), transparent 70%); }
.health__state { font-size: 16px; font-weight: 800; }
.health__pulse {
  width: 12px; height: 12px; border-radius: 50%; flex: none; position: relative;
  background: var(--ok);
}
.health__hero--warn .health__pulse { background: var(--warn); }
.health__hero--err .health__pulse { background: var(--danger); }
.health__pulse::after {
  content: ''; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid currentColor; opacity: 0;
  animation: alert-ping 2s ease-out infinite;
}
.health__hero--ok .health__pulse::after { border-color: var(--ok); }
.health__hero--warn .health__pulse::after { border-color: var(--warn); }
.health__hero--err .health__pulse::after { border-color: var(--danger); }
/* min(320px,100%): a bare 320px minimum pushed the health cards off the left
   edge on 320–360px phones (RTL grid overflow) — the card was half off-screen */
.health__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 14px; }
.health__grid .card { margin: 0; }
.health__tables { display: flex; flex-direction: column; gap: 6px; }
.health__table {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 11px; border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--panel-2) 55%, transparent);
}
.health__table--missing, .health__table--repair { border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.health__table-name { font-size: 12px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; direction: ltr; text-align: start; }
.health__table .chip { font-size: 10px; padding: 2px 8px; flex: none; }
.health__table .btn { flex: none; }
.health__extras { margin-top: 4px; }
.health__checklist { margin-top: 10px; border-top: 1px dashed var(--stroke); padding-top: 10px; }
.health__checklist summary {
  cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--acc);
  display: flex; align-items: center; gap: 7px; list-style: none;
}
.health__checklist summary::-webkit-details-marker { display: none; }
.health__checklist summary svg { width: 14px; height: 14px; }
.health__checklist ol { margin: 10px 0 2px; padding-inline-start: 20px; }
.health__checklist li { font-size: 12.5px; color: var(--muted); margin: 5px 0; line-height: 1.8; }
.chip--warn {
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent);
}

/* ---------- 2.3 · unified inbox ---------- */
.addr-item--all { border: 1px solid transparent; }
.addr-item__ava--all { color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.addr-item__ava--all svg { width: 15px; height: 15px; }
.email-row__mbox {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--stroke);
  border-radius: 99px; padding: 1px 8px;
  max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  direction: ltr;
}
.kind-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--acc); flex: none; }
.kind-dot--temp { background: var(--warn); }

/* ============================================================
   2.6 · tidy inbox, per-account cards, domain cards,
          gliding nav indicator, toast close, temp-vault lock
   ============================================================ */

/* ---------- inbox header: the account identity plate ---------- */
.mail__head-id { display: flex; align-items: center; gap: 4px; min-width: 0; }
.icon-btn--xs { width: 28px; height: 28px; border-radius: 9px; }
.icon-btn--xs svg { width: 14px; height: 14px; }

/* the vault's identity chip — whose 2FA room this is (per-account vault) */
.vault-id {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--stroke);
  border-radius: 99px; padding: 4px 12px 4px 5px;
  max-width: 100%;
}
[dir="rtl"] .vault-id { padding: 4px 5px 4px 12px; }
.vault-id__addr {
  font-size: 11.5px; font-weight: 700; direction: ltr;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 200px;
}
.vault-id .lockbadge { flex: none; }

/* one card = one account on the Inboxes page — the live badge must never
   sit on top of the address: the id box reserves the badge's width */
.acct-card.is-live .acct-card__id { padding-inline-end: 92px; }
.addr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; overflow: hidden; }
.stat-tile__icn { color: var(--acc); opacity: .9; }
.stat-tile__icn svg { width: 19px; height: 19px; }
.stat-tile.is-warm::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% -30%, color-mix(in srgb, var(--acc) 14%, transparent), transparent 70%);
}
.addr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 13px; }
.acct-card { padding: 16px 16px 13px; position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; transition: transform .3s var(--spring), box-shadow .3s, border-color .3s; }
.acct-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.acct-card.is-live { border-color: var(--acc-line); box-shadow: 0 0 0 3px var(--acc-soft), var(--shadow-soft); }
.acct-card__live {
  position: absolute; top: 13px; inset-inline-end: 13px;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase;
  color: var(--acc); background: var(--acc-soft); border: 1px solid var(--acc-line);
  border-radius: 99px; padding: 2.5px 9px;
}
.acct-card__live svg { width: 11px; height: 11px; }
.acct-card__main { cursor: pointer; outline: none; }
.acct-card__main:focus-visible { border-radius: 10px; box-shadow: 0 0 0 3px var(--acc-soft); }
.acct-card__idrow { display: flex; align-items: center; gap: 12px; }
.acct-card__id { min-width: 0; flex: 1; }
.acct-card__addr {
  font-size: 14px; font-weight: 700; letter-spacing: .1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: block; max-width: 100%;
}
.acct-card__tags { display: flex; gap: 5px; margin-top: 4px; flex-wrap: wrap; }
.kind-tag--label { background: var(--panel-2); color: var(--muted); border: 1px solid var(--stroke); }
.acct-card__nums { display: flex; gap: 0; border-top: 1px solid var(--stroke); padding-top: 11px; }
.acct-card__num { flex: 1; min-width: 0; text-align: center; }
.acct-card__num + .acct-card__num { border-inline-start: 1px solid var(--stroke); }
.acct-card__num b { display: block; font-size: 14.5px; font-weight: 800; direction: ltr; }
.acct-card__num b.is-urgent { color: var(--warn); }
.acct-card__num span { font-size: 9.5px; color: var(--muted); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.acct-card__actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.acct-card__open { margin-inline-start: auto; }

/* ---------- domains page: stat strip + cards ---------- */
.dom-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 14px; }
.dom-stat { padding: 14px 16px; display: flex; align-items: center; gap: 12px; position: relative; overflow: hidden; }
.dom-stat__icn {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--acc-soft); color: var(--acc);
}
.dom-stat__icn svg { width: 18px; height: 18px; }
.dom-stat__n { font-size: 21px; font-weight: 800; line-height: 1.15; direction: ltr; }
.dom-stat__l { font-size: 10.5px; color: var(--muted); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.dom-stat.is-ok .dom-stat__icn { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.dom-stat.is-warm .dom-stat__icn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.dom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 13px; }
.dom-card { min-width: 0; padding: 15px 17px 13px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; transition: transform .3s var(--spring), box-shadow .3s, border-color .3s; }
.dom-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
/* a living aurora wash behind healthy domains — the page breathes */
.dom-card::after {
  content: ''; position: absolute; inset: -55% -30% auto auto; width: 62%; aspect-ratio: 1;
  pointer-events: none; z-index: 0;
  background: radial-gradient(circle, color-mix(in srgb, var(--acc) 13%, transparent), transparent 68%);
  filter: blur(30px); opacity: 0; transition: opacity .5s;
}
.dom-card:hover::after { opacity: 1; animation: domAurora 7s linear infinite; }
@keyframes domAurora { to { transform: rotate(1turn); } }
.dom-card > * { position: relative; z-index: 1; }
.dom-card::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 3.5px;
  background: linear-gradient(to bottom, var(--acc), color-mix(in srgb, var(--acc) 30%, transparent));
  opacity: .85;
}
.dom-card--wip::before { background: linear-gradient(to bottom, var(--warn), color-mix(in srgb, var(--warn) 30%, transparent)); }
.dom-card__trail { display: flex; gap: 4px; flex-wrap: wrap; }
.dom-trail {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase;
  color: var(--faint);
}
.dom-trail i { width: 6px; height: 6px; border-radius: 50%; background: var(--stroke-2); flex: none; transition: all .3s; }
.dom-trail.is-done { color: var(--muted); }
.dom-trail.is-done i { background: var(--acc); }
.dom-trail.is-now { color: var(--warn); }
.dom-trail.is-now i { background: var(--warn); animation: trailPulse 1.6s ease-in-out infinite; }
@keyframes trailPulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--warn) 45%, transparent); } 50% { box-shadow: 0 0 0 4px transparent; } }
.dom-card__head { display: flex; align-items: center; gap: 12px; }
.dom-card__globe {
  width: 40px; height: 40px; border-radius: 13px; flex: none;
  display: grid; place-items: center;
  background: var(--acc-soft); color: var(--acc);
  transition: transform .35s var(--spring);
  position: relative;
}
/* a healthy, live domain wears a soft heartbeat ring */
.dom-card.is-alive .dom-card__globe::after {
  content: ''; position: absolute; inset: -3px; border-radius: 15px;
  border: 1.5px solid color-mix(in srgb, var(--ok) 55%, transparent);
  animation: domHeartbeat 2.6s ease-in-out infinite;
}
@keyframes domHeartbeat { 0%, 100% { opacity: .35; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
.dom-card:hover .dom-card__globe { transform: rotate(-8deg) scale(1.06); }
.dom-card__globe svg { width: 19px; height: 19px; }
.dom-card__namebox { min-width: 0; flex: 1; }
.dom-card__name {
  font-size: 15px; font-weight: 700; direction: ltr; text-align: start;
  overflow: hidden;
  display: flex; align-items: center; gap: 6px; cursor: copy; min-width: 0;
}
/* the domain text itself shrinks with a real ellipsis — a bare text node in a
   flex row used to push the copy icon out of the card on narrow screens */
.dom-card__txt { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dom-card__name svg { width: 13px; height: 13px; color: var(--faint); flex: none; transition: color .2s; }
.dom-card__name:hover svg { color: var(--acc); }
.dom-card__status { margin-top: 4px; display: flex; }
.dom-card__switches { display: flex; flex-direction: column; gap: 0; border-block: 1px solid var(--stroke); }
.set-row--card { padding: 9px 2px; border-bottom: 1px solid var(--stroke); }
.set-row--card:last-child { border-bottom: 0; }
.set-row--card .set-row__t { font-size: 12.5px; }
.dom-card__nums { display: flex; }
.dom-card__num { flex: 1; text-align: center; }
.dom-card__num + .dom-card__num { border-inline-start: 1px solid var(--stroke); }
.dom-card__num b { display: block; font-size: 13.5px; font-weight: 800; direction: ltr; }
.dom-card__num span { font-size: 9.5px; color: var(--muted); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.dom-card__actions { display: flex; align-items: center; gap: 6px; }

/* ---------- 2FA vault: the temporary lock ---------- */
.temp-guard {
  display: flex; flex-direction: column; gap: 9px;
  padding: 13px 15px; border-radius: 13px;
  background: color-mix(in srgb, var(--warn) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
}
.temp-guard--inline { flex-direction: row; align-items: center; gap: 10px; padding: 10px 13px; font-size: 12px; font-weight: 600; color: var(--warn); }
.temp-guard--inline svg { width: 15px; height: 15px; flex: none; }
.temp-guard__addr {
  font-size: 12.5px; font-weight: 700; direction: ltr; text-align: start;
  background: var(--panel); border: 1px solid var(--stroke);
  border-radius: 9px; padding: 6px 11px; align-self: flex-start; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.temp-guard__text { margin: 0; font-size: 13px; line-height: 1.75; }
.temp-guard__note {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 700; color: var(--warn);
}
.temp-guard__note svg { width: 14px; height: 14px; flex: none; }
.totp-temp {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 800; color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  border-radius: 99px; padding: 2px 9px;
}
.totp-temp svg { width: 11px; height: 11px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .acct-switch { max-width: 44vw; }
  .acct-switch__name { max-width: 90px; }
  .addr-grid, .dom-grid { grid-template-columns: 1fr; }
  .addr-stats, .dom-stats { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .menu--accts { position: fixed; top: 60px; inset-inline: 10px; width: auto; }
  .acct-card__actions .btn:not(.acct-card__open):not(.btn--primary) span { display: none; }
  .acct-card__addr { font-size: 13px; }
  .acct-card.is-live .acct-card__id { padding-inline-end: 84px; }
  .addr-grid > *, .dom-grid > *, .stat-tile { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pill-glider { transition: opacity .3s; }
  .dom-trail.is-now i { animation: none; }
}
.dom-trail__sep { width: 9px; height: 1px; background: var(--stroke-2); margin-inline: 2px; flex: none; align-self: center; }
/* the inbox search fits inside its column (margins included) */
.mail__col > .mail__search { width: auto !important; align-self: stretch; }
/* the inbox account switcher floats above everything, attached to <body> */
.acct-switch-pop { position: fixed; inset: 0; z-index: 130; pointer-events: none; }
.acct-switch-pop .menu--accts { position: fixed; pointer-events: auto; }

/* ============================================================
   v2.9.5 — per-account mail folders (rail + manager + row flag)
   ============================================================ */
.mfolders-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 12px 6px 4px; padding-top: 10px; border-top: 1px dashed var(--stroke);
  font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted);
}
.mfolders-head .icon-btn { width: 24px; height: 24px; border-radius: 8px; }
.mfolders-head .icon-btn svg { width: 13px; height: 13px; }
.mfolder--ghost { border: 1px dashed var(--stroke); border-radius: 11px; opacity: .75; }
.mfolder--ghost:hover { opacity: 1; }
.mail-folders--sub { margin-top: 2px; }
.mfolder .fdot { flex: none; }

/* folder color dots — tiny, warm, never loud */
.fdot {
  width: 9px; height: 9px; border-radius: 50%;
  display: inline-block; flex: none;
  box-shadow: 0 0 0 2.5px color-mix(in srgb, var(--panel) 70%, transparent);
}
.fdot--amber { background: #dcb567; } .fdot--mint { background: #93c793; }
.fdot--sky { background: #8fb8d8; } .fdot--rose { background: #dd9a9a; }
.fdot--violet { background: #b3a1d1; }
.fdot--btn { width: 22px; height: 22px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--stroke-2); transition: transform .2s var(--spring); }
.fdot--btn:hover { transform: scale(1.12); }
.email-row__flags .flag-folder { width: 8px; height: 8px; box-shadow: none; opacity: .85; }

/* folder manager rows */
.fm-list { display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow: auto; padding: 2px; }
.fm-row {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid var(--stroke); border-radius: 14px; padding: 11px 12px;
  background: var(--panel-2);
}
.fm-row__fields { flex: 1; min-width: 0; }
.fm-row__line { display: flex; align-items: center; gap: 8px; }
.fm-row__line .input { flex: 1; min-width: 0; }
.fm-row__n { font-size: 10.5px; font-weight: 700; color: var(--muted); white-space: nowrap;
  font-variant-numeric: tabular-nums; }

/* the little label above folder entries inside action menus */
.menu-act__label {
  font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); padding: 7px 4px 1px; border-top: 1px dashed var(--stroke);
  margin-top: 4px;
}
.menu-stack .menu-act .fdot { margin-inline-end: 2px; }

/* ============================================================
   v2.9.5 — compose, rebuilt: inline rows, growing body, honest errors
   ============================================================ */
.compose { display: flex; flex-direction: column; }
.compose__line {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 2px; border-bottom: 1px solid var(--stroke);
}
.compose__k {
  flex: none; width: 52px; padding-top: 9px;
  font-size: 11px; font-weight: 800; color: var(--muted); text-align: end;
}
.compose__v { flex: 1; min-width: 0; }
.compose__fromrow { display: flex; align-items: center; gap: 8px; }
.compose__fromrow .compose__sel { flex: 1; min-width: 0; }
.compose__sel { border: 0; background: transparent; box-shadow: none; padding-inline-start: 2px; font-weight: 650; }
.compose__sel:focus:not(:focus-visible) { outline: none; }
.compose__in { border: 0; background: transparent; box-shadow: none; padding-inline-start: 2px; font-weight: 600; }
.compose__in:focus:not(:focus-visible) { outline: none; box-shadow: none; }
.compose__body {
  border: 0; background: transparent; box-shadow: none;
  margin-top: 8px; min-height: 170px; max-height: 380px;
  resize: none; line-height: 1.75; padding-inline-start: 2px;
}
.compose__body:focus:not(:focus-visible) { outline: none; box-shadow: none; }
.compose__err {
  display: flex; align-items: center; gap: 6px; margin-top: 6px;
  font-size: 11.5px; font-weight: 700; color: var(--danger);
}
.compose__err svg { width: 13px; height: 13px; flex: none; }
.compose__err.hidden { display: none; }
.compose__draft { font-size: 11px; font-weight: 650; color: var(--muted); align-self: center; }
.compose__send .spin--inline { display: inline-flex; }
.spin--inline svg { animation: spinOnce .9s linear infinite; }
@keyframes spinOnce { to { transform: rotate(360deg); } }
.modal--compose .modal__body { padding-bottom: 6px; }
.modal--compose .modal__foot { align-items: center; }
/* v3.0.0 — the compose footer is the SEND row: the tools ride first, the
   draft note follows, and the send key closes the row — the far END of the
   reading direction in both languages (the WhatsApp/Telegram muscle memory:
   LTR → right edge, RTL → left edge). A hairline separates the row from the
   message body so it reads as its own piece of furniture. */
.compose__foot {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding-top: 12px; margin-top: 4px;
  border-top: 1px solid var(--stroke);
  /* v3.2.5 — the send row never scrolls away: sticky to the sheet's floor,
     on its own glass slab, lifted above the keyboard via --kb-h (iOS keeps
     the layout viewport on focus; the visualViewport handler writes the
     real occluded height and Android self-corrects via resizes-content) */
  position: sticky; bottom: 0; z-index: 2;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  padding-bottom: calc(10px + var(--kb-h, 0px));
}
.compose__tools { order: 1; }
.compose__foot-note { order: 2; margin-inline-start: auto; display: inline-flex; min-width: 0; }
.compose__send { order: 3; margin-inline-start: 6px; }
.compose__send {
  min-width: 132px; justify-content: center; padding-block: 10px; font-size: 14.5px;
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--acc) 60%, transparent);
}
/* the paper plane points where the message flies: mirrored in RTL */
[dir='rtl'] .compose__send .icn svg,
[dir='rtl'] .compose-fab .icn svg { transform: scaleX(-1); }

/* ============================================================
   v3.2.0 — compose, the studio cut: attachment chips with live
   image thumbs, a tool rail in the footer, a kbd hint on the end
   ============================================================ */
.compose__atts {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 2px 2px; border-bottom: 1px solid var(--stroke);
}
.att-chip--new {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 6px; border-radius: 12px;
  background: var(--field); border: 1px solid var(--stroke);
  animation: attIn .25s var(--spring);
  max-width: 240px;
}
@keyframes attIn { from { opacity: 0; transform: translateY(6px) scale(.92); } to { opacity: 1; transform: none; } }
.att-chip__thumb {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  background-size: cover; background-position: center;
  border: 1px solid var(--stroke); background-color: var(--panel-2);
}
.att-chip__glyph {
  width: 34px; height: 34px; flex: none; border-radius: 9px; display: grid; place-items: center;
  color: var(--acc); background: color-mix(in srgb, var(--acc) 12%, transparent);
}
.att-chip__glyph svg { width: 16px; height: 16px; }
.att-chip__meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.att-chip__meta b { font-size: 11.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-chip__meta .faint { font-size: 10px; color: var(--faint); font-variant-numeric: tabular-nums; }
.att-chip__x {
  flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  color: var(--muted); transition: all .15s;
}
.att-chip__x:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.att-chip__x svg { width: 12px; height: 12px; }
.compose__att-hint { font-size: 10px; color: var(--faint); align-self: center; }
.compose__body.is-drop {
  background: color-mix(in srgb, var(--acc) 7%, transparent);
  border-radius: 10px; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--acc) 45%, transparent);
}
.compose__tools { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: 2px; }
.compose__tool { width: 34px; height: 34px; border-radius: 11px; color: var(--muted); transition: all .2s var(--spring); }
.compose__tool:hover { color: var(--acc); background: color-mix(in srgb, var(--acc) 12%, transparent); transform: translateY(-1px); }
.compose__tool--discard:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.compose__cancel { margin-inline-start: 4px; }
.compose__kbd {
  margin-inline-start: 8px; padding: 2px 7px; border-radius: 7px;
  font: 700 10px/1.4 var(--font-mono, ui-monospace, monospace);
  color: var(--faint); background: var(--field); border: 1px solid var(--stroke);
}
/* the modal head carries a sigil plate: the paper plane rides a gradient tile */
.modal--compose .modal__title svg { width: 15px; height: 15px; }
.modal--compose .modal__head { padding-bottom: 10px; border-bottom: 1px solid var(--stroke); margin-bottom: 2px; }

/* ============================================================
   v2.9.5 — the living color room · soft controls · dynamic island
   ============================================================ */

/* ---------- eight more palettes — twelve in all, named after their
   colors; switching one repaints the whole room: stage glows, beams,
   glass tints and highlights all follow ---------- */
html[data-accent='rose']    { --acc-l: #f0b6c4; --acc-d: #bf5470; --acc-ink: #33111d; --mood-bg: #1f1419; --mood-bg-l: #f9f1f4; }
html[data-accent='cyan']    { --acc-l: #8fd8d2; --acc-d: #2f8f8a; --acc-ink: #0c2b29; --mood-bg: #101c1b; --mood-bg-l: #eef6f5; }
html[data-accent='orange']  { --acc-l: #f0b084; --acc-d: #c06a2a; --acc-ink: #2d180a; --mood-bg: #1f1712; --mood-bg-l: #f9f3ec; }
html[data-accent='lime']    { --acc-l: #cfe39a; --acc-d: #7ba03a; --acc-ink: #1c2409; --mood-bg: #191d10; --mood-bg-l: #f5f8ea; }
html[data-accent='teal']    { --acc-l: #9ad4c0; --acc-d: #2e8570; --acc-ink: #0a2620; --mood-bg: #111d18; --mood-bg-l: #eff6f2; }
html[data-accent='indigo']  { --acc-l: #aab3ee; --acc-d: #5560c0; --acc-ink: #12142e; --mood-bg: #14161f; --mood-bg-l: #f0f1f8; }
html[data-accent='slate']   { --acc-l: #b3c0cf; --acc-d: #5d7285; --acc-ink: #101820; --mood-bg: #14181c; --mood-bg-l: #f1f4f6; }
html[data-accent='crimson'] { --acc-l: #eda9a4; --acc-d: #bb4a42; --acc-ink: #2d0e0c; --mood-bg: #1f1413; --mood-bg-l: #f9f1f0; }

/* ---------- soft, springy controls — every press has a feel ---------- */
.btn, .chip, .icon-btn, .pill-nav, .tab, .inbox-selbox, .fdot--btn, .note-dot,
.palette-card, .seg button, .acct-oval__copy, .att-chip, .dom-card__globe {
  transition: transform .16s var(--spring), box-shadow .28s var(--ease),
    background .22s var(--ease), border-color .22s var(--ease),
    color .18s var(--ease), opacity .2s var(--ease);
}
.btn:hover { transform: translateY(-1.5px); }
.btn:active { transform: translateY(0) scale(.965); }
.chip:hover { transform: translateY(-1px); }
.chip:active { transform: scale(.94); }
.icon-btn:hover { transform: translateY(-1px) scale(1.06); }
.icon-btn:active { transform: scale(.92); }
.tab:active, .pill-nav:active { transform: scale(.96); }
.btn:disabled, .btn.is-locked, .btn.is-frozen { transform: none !important; }
.btn--primary:hover:not(:disabled) {
  box-shadow: 0 12px 30px -12px color-mix(in srgb, var(--acc) 72%, transparent), var(--inset);
}
/* a light sweep crosses primary buttons on hover — soft, never loud */
.btn--primary:not(:has(.lockbadge)) { position: relative; overflow: hidden; }
.btn--primary:not(:has(.lockbadge))::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .26) 50%, transparent 68%);
  transform: translateX(-130%);
  transition: transform .7s var(--ease);
}
.btn--primary:not(:has(.lockbadge)):hover:not(:disabled)::after { transform: translateX(130%); }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--acc) 62%, transparent); outline-offset: 2px; }
@media (hover: none) {
  .btn:hover, .chip:hover, .icon-btn:hover { transform: none; }
}

/* ---------- the dynamic island — live word of every send & arrival ---------- */
.dyn-island {
  position: fixed; top: calc(var(--pill-h) + 22px); left: 50%;
  z-index: 160;
  transform: translateX(-50%) translateY(-18px) scale(.88);
  opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px;
  width: max-content; max-width: min(440px, calc(100vw - 20px));
  padding: 8px 11px; border-radius: 20px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border: 1px solid var(--stroke-2);
  backdrop-filter: blur(26px) saturate(1.6);
  -webkit-backdrop-filter: blur(26px) saturate(1.6);
  box-shadow: 0 22px 46px -18px rgba(0, 0, 0, .5), var(--inset);
  transition: transform .5s var(--spring), opacity .28s var(--ease);
  cursor: pointer; user-select: none; -webkit-user-select: none;
  font-size: 12.5px; font-weight: 700; color: var(--fg);
}
.dyn-island.is-in { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; pointer-events: auto; }
.dyn-island__icn {
  width: 30px; height: 30px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: var(--acc-soft); color: var(--acc);
  position: relative; overflow: hidden;
}
.dyn-island__icn svg { width: 15px; height: 15px; }
.dyn-island__icn.is-ok { background: color-mix(in srgb, var(--ok) 17%, transparent); color: var(--ok); }
.dyn-island__icn.is-warn { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
/* a soft halo breathes behind the icon while something is in flight */
.dyn-island.is-busy .dyn-island__icn::after {
  content: ''; position: absolute; inset: -5px; border-radius: 14px;
  border: 1.5px solid color-mix(in srgb, var(--acc) 55%, transparent);
  animation: islandHalo 1.6s ease-in-out infinite;
}
@keyframes islandHalo { 0%, 100% { opacity: .25; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.04); } }
.dyn-island__txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.dyn-island__t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dyn-island__d {
  font-size: 10.5px; color: var(--muted); font-weight: 650;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 230px;
}
.dyn-island__act {
  flex: none; border: 0; cursor: pointer;
  background: var(--acc); color: var(--acc-text);
  font-size: 11px; font-weight: 800; border-radius: 99px; padding: 5.5px 13px;
  font-family: inherit;
  transition: transform .16s var(--spring), filter .2s;
}
.dyn-island__act:hover { transform: scale(1.05); filter: brightness(1.06); }
.dyn-island__act:active { transform: scale(.94); }
.dyn-island .spin--inline { display: inline-flex; }
.dyn-island .spin--inline svg { animation: spinOnce .9s linear infinite; }
@media (max-width: 860px) {
  .dyn-island { top: calc(var(--pill-h) + 16px); }
  .dyn-island__d { max-width: 150px; }
}

/* ---------- advanced details: the message's paperwork ---------- */
.mailx { border-top: 1px solid var(--stroke); }
.mailx > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  padding: 11px 24px; font-size: 12px; font-weight: 800; color: var(--muted);
  transition: color .2s, background .2s;
  user-select: none;
}
.mailx > summary::-webkit-details-marker { display: none; }
.mailx > summary:hover { color: var(--acc); background: var(--hover); }
.mailx > summary > svg { width: 14px; height: 14px; }
.mailx > summary .mailx__chev { margin-inline-start: auto; display: inline-flex; transition: transform .3s var(--ease); }
.mailx > summary .mailx__chev svg { width: 13px; height: 13px; }
.mailx[open] > summary .mailx__chev { transform: rotate(90deg); }
.mailx__in { padding: 2px 24px 16px; display: flex; flex-direction: column; gap: 7px; }
.mailx__row { display: flex; gap: 12px; align-items: baseline; }
.mailx__k {
  flex: none; width: 128px;
  color: var(--muted); font-weight: 800;
  font-family: var(--font-mono); font-size: 10.5px;
}
.mailx__v {
  flex: 1; min-width: 0;
  direction: ltr; text-align: start; word-break: break-word;
  font-family: var(--font-mono); font-size: 11px; line-height: 1.6; opacity: .92;
}
.mailx__auth { display: flex; gap: 6px; flex-wrap: wrap; }
.mailx__copy { margin-inline-start: auto; flex: none; }
@media (max-width: 640px) {
  .mailx > summary { padding: 10px 16px; }
  .mailx__in { padding: 2px 16px 14px; }
  .mailx__row { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px; }
  .mailx__k { width: auto; }
  .mailx__row .mailx__copy { grid-column: 2; grid-row: 1; }
  .mailx__v { grid-column: 1 / -1; }
  .mailx__copy { margin-inline-start: 0; }
}

/* ---------- sent mail wears its own quiet flag ---------- */
.flag-sent { display: inline-flex; align-items: center; color: var(--acc); opacity: .8; }
.flag-sent svg { width: 11.5px; height: 11.5px; }
/* the one-tap select mode is a touch tool — pointer devices already hover */
.mail__selmode { display: none; }
@media (max-width: 640px) { .mail__selmode { display: inline-flex; } }
.flag-sent.is-out { color: var(--acc-d); }

/* ---------- the room sits a breath higher — the list leads ---------- */
.mail__main { gap: 8px; }
.inbox-card { border-radius: 17px; }
@media (min-width: 861px) {
  .mail__ovalrow { margin-bottom: -1px; }
  .mail__search { padding-block: 8px !important; }
}

/* ---------- mobile: the reader, the compose table, the account cards —
   nothing piles up, nothing overflows ---------- */
@media (max-width: 640px) {
  /* reader top bar: icon-first, one clean row */
  .reader__top { gap: 6px; }
  .reader__navbtns { margin-inline-start: auto; }
  .reader__top .btn { padding: 7px 9px !important; }
  /* the head block wraps honestly instead of squeezing */
  .viewer__head { padding: 15px 16px 12px; }
  .viewer__meta { gap: 9px; }
  .viewer__meta .avatar { width: 32px !important; height: 32px !important; border-radius: 10px !important; }
  .viewer__actions { width: 100%; order: 3; margin-inline-start: 0; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .viewer__actions::-webkit-scrollbar { display: none; }
  .viewer__actions .btn { flex: none; }
  .reader__card .viewer__head { padding: 15px 16px 12px; }
  .reader__card .mtools { padding: 10px 16px 0; flex-wrap: wrap; gap: 7px; }
  .reader__card .mail-frame-wrap { padding: 8px 12px 12px; }
  .reader__card .attachments { padding: 8px 16px; }
  .reader__subj { font-size: 17px; }
  /* compose: labels step above their fields — no more crush */
  .compose__line { flex-direction: column; align-items: stretch; gap: 4px; padding: 7px 2px; }
  .compose__k { width: auto; padding-top: 0; text-align: start; }
  .compose__body { min-height: 130px; }
  .modal--compose .modal__foot { flex-wrap: wrap; gap: 8px; }
  .modal--compose .compose__foot { flex-wrap: wrap; }
  .modal--compose .compose__send { flex: 1 1 100%; justify-content: center; }
  .modal--compose .compose__foot-note { width: 100%; justify-content: center; }
  /* bulk actions become a thumb-reachable bottom bar */
  .inbox-bulk {
    position: sticky; bottom: 0; z-index: 5;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--stroke);
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  }
  .inbox-bulk::-webkit-scrollbar { display: none; }
  .inbox-bulk .chip { flex: none; padding: 9px 14px; font-size: 12.5px; }
}

/* ---------- palette wall: twelve swatches, breathing on hover ---------- */
.palette-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 9px; }
.palette-card__swatch {
  height: 46px; border-radius: 12px; position: relative; overflow: hidden;
  transition: transform .35s var(--spring);
}
.palette-card:hover .palette-card__swatch { transform: scale(1.045); }
.palette-card__swatch::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 34%, rgba(255, 255, 255, .35) 50%, transparent 66%);
  transform: translateX(-130%);
  transition: transform .8s var(--ease);
}
.palette-card:hover .palette-card__swatch::before { transform: translateX(130%); }

/* ============================================================
   round 4 — 2FA padlock · devices · 404/offline art · dns check
   + the mobile inbox making itself beautiful
   ============================================================ */

/* ---------- the 2FA padlock at the top ---------- */
.icon-btn.lock-badge { color: var(--acc); position: relative; }
.icon-btn.lock-badge svg { filter: drop-shadow(0 0 7px color-mix(in srgb, var(--acc) 55%, transparent)); }
.icon-btn.lock-badge::after {
  content: ''; position: absolute; inset: 4px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--acc) 35%, transparent);
  animation: lockPulse 2.6s var(--ease) infinite;
}
@keyframes lockPulse {
  0%, 100% { opacity: .25; transform: scale(.86); }
  50% { opacity: .8; transform: scale(1.06); }
}

/* ---------- mascot illustration plate (offline gate + 404) ---------- */
.illus-plate {
  width: clamp(180px, 30vw, 236px); aspect-ratio: 1; margin-inline: auto;
  border-radius: 30px; background: #fdfdfc; overflow: hidden;
  box-shadow: 0 22px 54px -20px rgba(8, 14, 9, .55), 0 4px 14px -6px rgba(8, 14, 9, .25);
  animation: floaty 6s ease-in-out infinite;
}
.illus-plate img { width: 100%; height: 100%; object-fit: cover; display: block; }
.illus-plate--sm { width: clamp(150px, 26vw, 190px); border-radius: 26px; animation: none; }
.nf404 { min-height: calc(100svh - var(--shell-top) - 40px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.nf404__t { font-size: 24px; font-weight: 800; margin: 18px 0 0; }
.nf404__d { color: var(--muted); max-width: 380px; line-height: 1.9; margin: 0 0 16px; }

/* ---------- devices & sessions ---------- */
.dev-list { display: flex; flex-direction: column; gap: 8px; }
.dev-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: var(--panel);
}
.dev-row.is-current { border-color: var(--acc-line); background: color-mix(in srgb, var(--acc) 7%, var(--panel)); }
.dev-row__icn { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--field); color: var(--acc); box-shadow: var(--inset); }
.dev-row__icn svg { width: 19px; height: 19px; }
.dev-row__body { min-width: 0; flex: 1; }
.dev-row__name { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dev-row__chip { font-size: 11px; padding: 2px 9px; }
.dev-row__meta { color: var(--muted); font-size: 11.5px; direction: ltr; text-align: left; unicode-bidi: embed; }
.dev-row .btn--danger-ghost { flex: none; }

/* ---------- live dns check ---------- */
.dns-check { display: flex; flex-direction: column; gap: 10px; }
.dns-line {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px;
  border-radius: var(--radius-sm); border: 1px solid var(--stroke); background: var(--panel);
}
.dns-line b { display: block; font-size: 13.5px; }
.dns-line__icn {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 10px; margin-top: 2px;
}
.dns-line__icn svg { width: 16px; height: 16px; }
.dns-line.is-ok .dns-line__icn { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.dns-line.is-warm .dns-line__icn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.dns-line.is-bad .dns-line__icn { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.dns-records {
  direction: ltr; text-align: left; font-size: 12px; color: var(--muted);
  background: var(--field); border-radius: 10px; padding: 8px 12px; overflow-wrap: anywhere;
  box-shadow: var(--inset); display: flex; flex-direction: column; gap: 3px;
}

/* ============================================================
   mobile inbox — خفن و خفن‌تر
   ============================================================ */

/* rows arrive with a tiny stagger — only on the first paint of the list,
   never on the silent background refreshes (a class is added then removed) */
@keyframes rowIn {
  from { opacity: 0; transform: translateY(9px) scale(.992); }
  to { opacity: 1; transform: none; }
}
.inbox-card__list.animate-in .email-row {
  animation: rowIn .38s var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 11) * 26ms);
}
@media (prefers-reduced-motion: reduce) {
  .inbox-card__list.animate-in .email-row { animation: none; }
}

/* unread rows wear their accent on their edge — glanceable at arm's length */
.email-row.is-unread { position: relative; }
.email-row.is-unread::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 14%; bottom: 14%;
  width: 3px; border-radius: 99px;
  background: linear-gradient(to bottom, var(--acc), color-mix(in srgb, var(--acc) 40%, transparent));
  opacity: .85;
}

/* the pull-to-refresh spring that lives above the list */
.ptr {
  position: absolute; inset-inline: 0; top: 4px; height: 40px;
  display: grid; place-items: center; color: var(--acc); pointer-events: none;
  opacity: 0; transform: translateY(0); z-index: 3;
}
.ptr svg { width: 21px; height: 21px; transition: transform .2s var(--ease); }
.ptr.is-armed { opacity: 1; }
.ptr.is-ready { color: var(--ok); }
.ptr.is-spin svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* compose button breathes — the one thing the thumb is always hunting for */
.compose-fab { position: relative; }
.compose-fab::before {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--acc) 45%, transparent), transparent 70%);
  opacity: 0; z-index: -1;
}
.compose-fab:not(.is-locked)::before { animation: fabBreath 3.2s var(--ease) infinite; }
@keyframes fabBreath { 0%, 100% { opacity: .25; transform: scale(.9); } 50% { opacity: .75; transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .compose-fab:not(.is-locked)::before { animation: none; opacity: .4; } }

/* the active tab lands with a spring */
.tab.is-on svg { animation: tabPop .34s var(--spring); }
@keyframes tabPop { 0% { transform: scale(.82); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .tab.is-on svg { animation: none; } }

/* ============================================================
   Lock screen — the padlock really locks
   ============================================================ */
.lock {
  position: fixed; inset: 0; z-index: 400;
  display: grid; place-items: center; padding: 20px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  opacity: 0; transition: opacity .32s var(--ease);
}
.lock.is-on { opacity: 1; }
/* v3.2.1 — while the lock is on stage the shell around it goes dark too:
   deleting the overlay in the inspector must not reveal even the top bar
   (the unread count is a fact about the mailbox). */
body.is-locked .pillbar,
body.is-locked .side,
body.is-locked .fab-shell {
  filter: blur(10px) saturate(.8); opacity: .35; pointer-events: none;
  user-select: none; transition: filter .3s var(--ease), opacity .3s var(--ease);
}
.lock__card {
  width: min(380px, 100%); text-align: center;
  padding: 30px 26px 24px; border-radius: 24px;
  animation: lock-card .5s var(--spring) both;
}
@keyframes lock-card { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.lock__logo { width: 64px; height: auto; margin-bottom: 12px; }
/* v3.0.0 — the lock-mode sigil: the dedicated lock-mode mark floating above
   the card, tinted by the accent and breathing with it */
.lock__sigil {
  display: grid; place-items: center; width: 44px; height: 44px;
  margin: 0 auto 10px; border-radius: 14px;
  color: var(--acc-ink);
  background: linear-gradient(135deg, var(--acc-l), var(--acc-d));
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--acc) 70%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 35%, transparent);
  animation: floaty 6s ease-in-out infinite;
}
.lock__sigil svg { width: 21px; height: 21px; }
.lock__title { margin: 0 0 4px; font-size: 20px; }
.lock__sub { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }
.lock__card .auth-form { display: grid; gap: 10px; }

/* ============================================================
   Share access — the guest's Dynamic Island + admin list
   ============================================================ */
/* v3.0.0 r7 — the guest's Dynamic Island: one compact floating pill hangs
   under the navigation and morphs open into the honest details. It never
   pushes the page around: fixed, centered, pointer-events only on itself. */
.sisland {
  position: fixed; top: calc(var(--shell-top) - 12px); inset-inline: 0;
  z-index: 92;
  display: flex; flex-direction: column; align-items: center;
  pointer-events: none;
}
.sisland__pill {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 9px;
  height: 37px; padding-inline: 12px 7px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--acc) 36%, transparent);
  background: color-mix(in srgb, var(--acc) 13%, color-mix(in srgb, var(--bg) 76%, transparent));
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  color: var(--fg); font-size: 12.5px; font-weight: 650;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 10px 28px -14px color-mix(in srgb, var(--acc) 70%, transparent), var(--inset);
  transition: border-radius .4s var(--spring), background .3s var(--ease);
}
.sisland.is-open .sisland__pill {
  border-start-start-radius: 20px; border-start-end-radius: 20px;
  border-end-start-radius: 0; border-end-end-radius: 0;
}
.sisland__icn { display: inline-flex; color: var(--acc); }
.sisland__icn svg { width: 15px; height: 15px; }
.sisland__label { max-width: 30vw; overflow: hidden; text-overflow: ellipsis; }
.sisland__clock { display: inline-flex; align-items: center; gap: 5px; color: var(--acc); font-size: 12px; }
.sisland__clock svg { width: 13px; height: 13px; }
.sisland__cd { font-variant-numeric: tabular-nums; letter-spacing: .4px; font-weight: 700; }
.sisland__q {
  width: 25px; height: 25px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--acc) 24%, transparent);
  color: var(--acc);
  transition: transform .35s var(--spring);
}
.sisland__q svg { width: 14px; height: 14px; }
.sisland.is-open .sisland__q { transform: rotate(90deg); }
/* the morph: the details panel unfolds beneath the pill as one blob */
.sisland__body {
  pointer-events: auto;
  width: min(360px, calc(100vw - 28px));
  max-height: 0; opacity: 0; overflow: hidden;
  transform: translateY(-8px) scale(.96);
  border-radius: 0 0 20px 20px;
  border-inline: 1px solid transparent; border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--acc) 9%, color-mix(in srgb, var(--bg) 82%, transparent));
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  transition: max-height .42s var(--spring), opacity .28s var(--ease), transform .38s var(--spring),
    border-color .3s var(--ease);
}
.sisland.is-open .sisland__body {
  max-height: 460px; opacity: 1; transform: none;
  border-color: color-mix(in srgb, var(--acc) 36%, transparent);
  box-shadow: 0 18px 44px -18px color-mix(in srgb, var(--acc) 55%, transparent);
}
.sisland__in { padding: 4px 14px 13px; display: flex; flex-direction: column; gap: 8px; }
.sisland__row {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--muted); padding-top: 2px;
}
.sisland__row svg { width: 13px; height: 13px; opacity: .75; }
.sisland__row b { color: var(--fg); font-weight: 700; font-size: 12.5px; }
.sisland__boxes { display: flex; flex-direction: column; gap: 5px; }
.sisland__box {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 11px; border-radius: 12px; text-align: start;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--panel) 55%, transparent);
  color: var(--fg); font-size: 12.5px; cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.sisland__box:hover { border-color: color-mix(in srgb, var(--acc) 45%, transparent); }
.sisland__box .mono { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; direction: ltr; text-align: start; }
.sisland__box-icn { display: inline-flex; color: var(--acc); flex: none; }
.sisland__box-icn svg { width: 13px; height: 13px; }
.sisland__box-copy { display: inline-flex; color: var(--muted); flex: none; opacity: .7; }
.sisland__box-copy svg { width: 12.5px; height: 12.5px; }
.sisland__note {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 12px; line-height: 1.8; color: var(--muted);
  padding: 7px 11px; border-radius: 12px;
  background: color-mix(in srgb, var(--acc) 7%, transparent);
}
.sisland__note svg { width: 13px; height: 13px; flex: none; margin-top: 4px; opacity: .8; }
.sisland__acts { display: flex; justify-content: flex-end; }

.share-list { display: flex; flex-direction: column; gap: 10px; }
/* v3.0.0 — the mailbox picker: one chip per mailbox, tap to add or remove
   it from the credential's world; the count badge carries the domain so
   ten lookalike boxes stay tellable apart */
.share-addrgrid { display: flex; flex-wrap: wrap; gap: 7px; }
.share-addr { max-width: 100%; }
.share-addr .icn { width: 13px; height: 13px; flex: none; }
.share-addr__t { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-addr__n { font-size: 9.5px; opacity: .62; }
.share-cred-box { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.share-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--panel) 60%, transparent);
}
.share-row.is-off { opacity: .62; }
.share-row__main { min-width: 0; flex: 1; }
.share-row__name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: 14px; }
.share-row__live {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--acc); position: relative;
}
.share-row__live::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--acc); opacity: 0;
  animation: alert-ping 1.8s ease-out infinite;
}
.share-row__meta { margin-top: 3px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.share-row__perms { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.share-row__perms .chip { font-size: 11px; padding: 3px 9px; }
.share-row__acts { display: flex; flex-direction: column; gap: 6px; flex: none; align-items: stretch; }
@media (max-width: 640px) {
  .share-row { flex-direction: column; }
  .share-row__acts { flex-direction: row; flex-wrap: wrap; }
  .share-row__acts .btn { flex: 1 1 auto; justify-content: center; }
}

/* ============================================================
   v3.0.0 r5 — the suspended share: an icy, honest waiting room.
   An emptied share suspends; the guest still signs in but this
   frozen page answers until the first new email lands — then it
   melts away on its own, no reload needed.
   ============================================================ */
.share-frozen {
  position: fixed; inset: 0; z-index: 240; display: grid; place-items: center;
  padding: 20px;
  background: color-mix(in srgb, #0a1424 42%, color-mix(in srgb, var(--acc) 14%, transparent));
  backdrop-filter: blur(18px) saturate(1.15) brightness(.9);
  -webkit-backdrop-filter: blur(18px) saturate(1.15) brightness(.9);
  opacity: 0; transition: opacity .45s var(--ease);
}
.share-frozen.is-on { opacity: 1; }
.share-frozen.leaving { opacity: 0; transition: opacity .38s var(--ease); }
.share-frozen__card {
  width: min(430px, 94vw); text-align: center;
  padding: 30px 26px 24px; border-radius: 26px;
  animation: frostIn .6s var(--spring) both;
}
.share-frozen__sigil {
  display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 14px;
  border-radius: 18px; color: var(--acc-ink);
  background: linear-gradient(135deg, var(--acc-l), var(--acc-d));
  box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--acc) 75%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 40%, transparent);
  animation: floaty 6s ease-in-out infinite;
}
.share-frozen__sigil svg { width: 26px; height: 26px; }
.share-frozen__title { font-size: 19px; font-weight: 800; margin: 0 0 8px; color: var(--fg); }
.share-frozen__desc { font-size: 13.5px; line-height: 1.9; color: var(--muted); margin: 0 0 14px; }
/* the remaining time rides on the frozen card too — ticking, or standing
   perfectly still when the admin froze the countdown */
.share-frozen__clock {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin: 0 0 18px; font-size: 12.5px; color: var(--muted);
}
.share-frozen__clock .icn { width: 14px; height: 14px; opacity: .75; }
.share-frozen__left {
  font-size: 14px; font-weight: 700; color: var(--fg);
  letter-spacing: .3px;
  padding: 3px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--acc) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--acc) 30%, transparent);
}
.share-frozen__acts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
@keyframes frostIn { from { opacity: 0; transform: translateY(16px) scale(.94); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) { .share-frozen__card, .share-frozen__sigil { animation: none; } }

/* ============================================================
   v3.0.0 r6 — share control: viewable credentials, device rows,
   the suspension box. All inside the edit modal + the audit rows.
   ============================================================ */
.share-cred {
  padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--panel) 55%, transparent);
}
.share-cred .chip { max-width: 100%; }
.share-cred .chip .mono { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-devs { display: flex; flex-direction: column; gap: 8px; }
.share-dev {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 12px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--panel) 55%, transparent);
}
.share-dev__ic {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border-radius: 10px; color: var(--acc-ink);
  background: linear-gradient(135deg, var(--acc-l), var(--acc-d));
  box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--acc) 70%, transparent);
}
.share-dev__ic .icn { width: 15px; height: 15px; }
.share-dev__t { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.share-dev__t b { font-size: 12.5px; font-weight: 700; color: var(--fg); }
.share-dev__t .small { font-size: 11px; }
.share-dev .btn { flex: none; }
@media (max-width: 640px) {
  .share-cred .chip .mono { max-width: 150px; }
  .share-dev__t .small { display: none; }
}

/* ============================================================
   v3.2.0 — settings, the tight studio cut: icon-led card titles,
   tighter rows, the print-identity plate. One shared language for
   every pane: less padding, more signal.

==================================================== */
.set-card { padding: 16px 18px 14px; }
.set-card__t {
  display: flex; align-items: center; gap: 9px;
  font-size: 14.5px; font-weight: 800; margin: 0 0 4px;
  letter-spacing: -.2px;
}
.set-card__t .icn, .set-card__t svg {
  width: 17px; height: 17px; flex: none;
  color: var(--acc-ink);
  background: linear-gradient(135deg, var(--acc-l), var(--acc-d));
  border-radius: 8px; padding: 3.5px;
  box-shadow: 0 4px 10px -6px color-mix(in srgb, var(--acc) 65%, transparent);
}
.set-card__d { margin: 0 0 10px; }
.set-row--tight { padding-block: 9px; }
.set-row--tight + .set-row--tight { border-top: 1px dashed var(--stroke); }
.chip--iconed svg { width: 13px; height: 13px; }
/* the print-identity plate: the mark preview, checked like a stamp corner */
.print-logo__plate { flex: none; }
.print-logo__preview {
  display: grid; place-items: center; width: 64px; height: 64px;
  border-radius: 14px; border: 1.5px dashed var(--stroke-2);
  background-size: cover; background-position: center;
  background-color: var(--field); color: var(--faint);
  transition: border-color .2s;
}
.print-logo__preview svg { width: 20px; height: 20px; }
.print-logo__plate:hover .print-logo__preview { border-color: color-mix(in srgb, var(--acc) 55%, transparent); }
.is-hidden-btn { display: none !important; }
.set-row__txt { min-width: 0; }
@media (max-width: 640px) {
  .print-logo__preview { width: 54px; height: 54px; }
}

/* ============================================================
   v3.2.0 — the Update center (About page): installed vs latest,
   one honest check. A card that either celebrates or escorts.
   ============================================================ */
.upd {
  position: relative; overflow: hidden;
  border-radius: 20px; padding: 18px 20px 16px; margin-top: 16px;
}
.upd__glow {
  position: absolute; inset-inline-end: -60px; top: -70px; width: 240px; height: 240px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--acc) 22%, transparent), transparent 65%);
  filter: blur(30px);
}
.upd__head { position: relative; margin-bottom: 12px; }
.upd__title { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 800; }
.upd__title svg {
  width: 17px; height: 17px; flex: none; color: var(--acc-ink);
  background: linear-gradient(135deg, var(--acc-l), var(--acc-d));
  border-radius: 8px; padding: 3.5px;
  box-shadow: 0 4px 10px -6px color-mix(in srgb, var(--acc) 65%, transparent);
}
.upd__sub { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }
.upd__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.upd__pill {
  display: flex; flex-direction: column; gap: 1px; min-width: 128px;
  padding: 8px 14px; border-radius: 13px;
  background: var(--field); border: 1px solid var(--stroke);
  transition: border-color .25s, box-shadow .25s;
}
.upd__pill-k { font-size: 9.8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.upd__pill-v { font-size: 16.5px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.upd__pill.is-now { border-color: color-mix(in srgb, var(--acc) 40%, transparent); }
.upd__pill.is-ok { border-color: color-mix(in srgb, var(--ok, #58a06a) 55%, transparent); box-shadow: 0 4px 14px -8px color-mix(in srgb, var(--ok, #58a06a) 60%, transparent); }
.upd__pill.is-ok .upd__pill-v { color: var(--ok, #58a06a); }
.upd__pill.is-new { border-color: color-mix(in srgb, var(--acc) 60%, transparent); box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--acc) 70%, transparent); animation: updNewPop .4s var(--spring); }
.upd__pill.is-old { opacity: .75; }
@keyframes updNewPop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.upd__eq, .upd__arrow {
  display: grid; place-items: center; width: 24px; height: 24px; flex: none;
  color: var(--muted); font-weight: 800;
}
.upd__arrow svg { width: 15px; height: 15px; }
.upd__state { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; }
.upd__state b { display: block; font-size: 13.5px; font-weight: 800; }
.upd__stated { font-size: 11.8px; color: var(--muted); line-height: 1.7; }
.upd__sigil {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none;
  border-radius: 10px; color: #eef7ef;
  background: linear-gradient(135deg, #7cbf8a, #3f7f5a);
  box-shadow: 0 6px 14px -8px rgba(70, 140, 90, .8);
}
.upd__sigil svg { width: 15px; height: 15px; }
.upd__sigil--new {
  color: var(--acc-ink);
  background: linear-gradient(135deg, var(--acc-l), var(--acc-d));
  box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--acc) 75%, transparent);
}
.upd__sigil--err { background: linear-gradient(135deg, #d8a08c, #b05a44); }
.upd--checking { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.upd__spin, .upd__btnspin {
  display: inline-flex; width: 15px; height: 15px; margin-inline-end: 8px;
  border-radius: 50%; border: 2px solid var(--stroke-2); border-top-color: var(--acc);
  animation: updSpin .8s linear infinite;
}
.upd__btnspin { margin-inline-end: 0; }
@keyframes updSpin { to { transform: rotate(360deg); } }
.upd__steps {
  margin: 12px 0 0; padding: 12px 16px 12px 30px; border-radius: 13px;
  background: var(--field); border: 1px solid var(--stroke);
  font-size: 12px; color: var(--muted); line-height: 1.9;
}
.upd__steps li::marker { color: var(--acc); font-weight: 800; }
.upd__notes {
  margin-top: 10px; padding: 10px 14px; border-radius: 13px;
  background: color-mix(in srgb, var(--acc) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--acc) 26%, transparent);
  font-size: 11.8px;
}
.upd__notes b { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--acc); }
.upd__notes p { margin: 3px 0 0; white-space: pre-wrap; max-height: 130px; overflow: hidden; color: var(--muted); line-height: 1.7; }
.upd__acts { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.upd--pulse { animation: updPulse 1.4s var(--spring); }
@keyframes updPulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok, #58a06a) 45%, transparent); }
  70% { box-shadow: 0 0 0 16px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .upd--pulse, .upd__pill.is-new { animation: none; }
}

/* v3.2.0 — one card language for every settings pane: the h3 icon becomes
   the same gradient tile the rest of the studio wears, headings sit tighter,
   and the rows inside cards breathe a little less. Scoped to .glass.card h3
   so no other view's headings are touched. */
.glass.card h3 { font-size: 14px !important; margin: 0 0 8px !important; letter-spacing: -.2px; }
.glass.card h3 svg {
  width: 17px; height: 17px; flex: none;
  color: var(--acc-ink);
  background: linear-gradient(135deg, var(--acc-l), var(--acc-d));
  border-radius: 8px; padding: 3.5px;
  box-shadow: 0 4px 10px -6px color-mix(in srgb, var(--acc) 65%, transparent);
}
.glass.card h3 .icon-btn { pointer-events: none; width: 26px; height: 26px; border-radius: 8px; }
.glass.card h3 .icon-btn svg {
  background: none; border-radius: 0; padding: 0; box-shadow: none;
  width: 15px; height: 15px; color: var(--acc);
}
.glass.card .set-row { padding-block: 8px; }
.glass.card .set-row + .set-row { border-top: 1px dashed var(--stroke); }
.glass.card .set-row:first-of-type { margin-top: 2px; }
.glass.card > .field { margin-top: 6px; }

/* ============================================================
   v3.1.5 — the context menu, the update card, the domain dossier,
   the health ring, the compact share form
   ============================================================ */

/* ---------- the row context menu (right-click / kebab) ---------- */
.ctxmenu {
  position: fixed; z-index: 320; min-width: 208px; max-width: 300px;
  padding: 6px; border-radius: 14px;
  opacity: 0; transform: scale(.94) translateY(-4px);
  transform-origin: top;
  box-shadow: 0 18px 44px -14px rgba(0, 0, 0, .45), var(--shadow-soft);
  transition: opacity .16s var(--ease), transform .18s var(--spring);
}
.ctxmenu.is-open { opacity: 1; transform: none; }
.ctxmenu__it {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8.5px 10px; border: 0; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--fg); text-align: start;
  font: inherit; font-size: 12.5px; font-weight: 600;
  transition: background .15s, color .15s;
}
.ctxmenu__it svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.ctxmenu__it:hover { background: var(--hover); }
.ctxmenu__it:hover svg { color: var(--acc); }
.ctxmenu__it--danger { color: var(--danger); }
.ctxmenu__it--danger svg { color: var(--danger); }
.ctxmenu__it--danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.ctxmenu__sep { height: 1px; background: var(--stroke); margin: 5px 6px; }
.ctxmenu__head { padding: 5px 10px 3px; font-size: 10px; font-weight: 800; letter-spacing: .4px; color: var(--faint); text-transform: uppercase; }
@media (max-width: 640px) {
  .ctxmenu {
    left: 8px !important; right: 8px; top: auto !important;
    bottom: calc(10px + env(safe-area-inset-bottom));
    max-width: none; min-width: 0;
    transform: translateY(14px); transform-origin: bottom;
  }
  .ctxmenu.is-open { transform: none; }
  .ctxmenu__it { padding: 11.5px 12px; font-size: 13.5px; }
}

/* ---------- the about page's update card ---------- */
.ab-update { border-radius: 18px; padding: 14px 16px; margin-top: 14px; }
.ab-update__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ab-update__t { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.ab-update__t svg { width: 16px; height: 16px; color: var(--acc); }
.ab-update__head .btn { margin-inline-start: auto; }
.ab-update__st { display: flex; align-items: flex-start; gap: 7px; margin-top: 10px; line-height: 1.8; }
.ab-update__st svg { width: 15px; height: 15px; flex: none; margin-top: 3px; }
.ab-update__st--new { color: var(--fg); font-weight: 600; }
.ab-update__newt { display: flex; align-items: center; gap: 7px; }
.ab-update__newt svg { color: var(--acc); }

/* ---------- the domain dossier ---------- */
.dom-details__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 12px; }
.dom-fact { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 12px; background: var(--field); border: 1px solid var(--stroke); }
.dom-fact__icn { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: color-mix(in srgb, var(--acc) 14%, transparent); color: var(--acc); flex: none; }
.dom-fact__icn svg { width: 15px; height: 15px; }
.dom-fact__k { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.dom-fact__v { font-size: 12.5px; font-weight: 750; margin-top: 1px; }
.dom-details__sec { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--stroke); }
.dom-details__rec { margin-top: 12px; }
.diag-line { display: flex; align-items: flex-start; gap: 9px; padding: 8px 4px; border-bottom: 1px dashed var(--stroke); }
.diag-line:last-child { border-bottom: 0; }
.diag-line__icn { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 8px; flex: none; margin-top: 1px; }
.diag-line__icn svg { width: 13px; height: 13px; }
.diag-line.is-ok .diag-line__icn { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.diag-line.is-warn .diag-line__icn { background: color-mix(in srgb, var(--warn, #d9a441) 16%, transparent); color: var(--warn, #d9a441); }
.diag-line.is-bad .diag-line__icn { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.diag-line b { font-size: 12.5px; display: block; }
.diag-line .small { display: block; margin-top: 1px; line-height: 1.7; }

/* ---------- the health hero's score ring ---------- */
.health__ring { width: 66px; height: 66px; flex: none; color: var(--acc); }
.health__ring--ok { color: var(--ok, var(--acc)); }
.health__ring--warn { color: var(--warn, #d9a441); }
.health__ring--err { color: var(--danger); }
.health__acts .btn svg { width: 14px; height: 14px; }

/* ---------- compact share form (Settings → Share) ---------- */
.share-create__creds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-create__creds .row { flex-wrap: nowrap; min-width: 0; }
@media (max-width: 480px) {
  .share-create__creds { grid-template-columns: 1fr; }
  .share-create__creds .row { flex-wrap: wrap; }
}
@media (min-width: 900px) {
  .share-create__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 0 26px; }
  .share-create__col { min-width: 0; }
}

/* ---------- settings panes, a touch tighter ---------- */
.settings-grid > .glass.card { padding: 16px 16px 14px; }
.settings-grid .set-row { padding: 9px 0; }
.settings-grid h3 { letter-spacing: -.2px; }

/* ---------- help search ---------- */
.help-search .input { margin-top: 2px; }

/* ---------- the setup gate's completion row ---------- */
.gate__stay { font-size: 12.5px; }

/* ============================================================
   v3.2.2 — the attachment studio, the lightbox & viewers,
   the Cmail audio player, the storage fuel gauge
   ============================================================ */

/* ---------- attachment studio (reader) ---------- */
.atts { padding: 12px 24px 4px; border-top: 1px solid var(--stroke); }
.atts__head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg); opacity: .92; margin-bottom: 9px; }
.atts__head .icn svg { width: 14px; height: 14px; }
.atts__grid { display: flex; flex-wrap: wrap; gap: 8px; }
.att-card {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px;
  border-radius: 12px; background: color-mix(in srgb, var(--panel) 72%, transparent);
  border: 1px solid var(--stroke); font-size: 12px; text-align: start;
  transition: border-color .2s, background .2s, transform .15s;
  max-width: 100%;
}
button.att-card { cursor: pointer; color: var(--fg); }
.att-card:hover { border-color: color-mix(in srgb, var(--acc) 45%, transparent); background: var(--panel-2); }
.att-card:active { transform: scale(.985); }
.att-card--img { flex-direction: column; align-items: stretch; padding: 6px; width: 128px; }
.att-card__thumb {
  width: 100%; height: 76px; object-fit: cover; border-radius: 9px;
  background: var(--field); display: block; cursor: zoom-in;
}
.att-card__meta { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.att-card--img .att-card__meta { padding: 4px 2px 1px; }
.att-card__meta b { font-size: 11.5px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-card--img .att-card__meta b { max-width: 100%; }
.att-card__glyph {
  display: inline-flex; width: 30px; height: 30px; border-radius: 9px; flex: none;
  align-items: center; justify-content: center; background: var(--field);
}
.att-card__glyph svg { width: 15px; height: 15px; }
.att-card__glyph--audio { background: color-mix(in srgb, var(--acc) 16%, transparent); color: var(--acc); }
.att-card__glyph--video { background: color-mix(in srgb, #7c6cff 16%, transparent); color: color-mix(in srgb, #7c6cff 55%, var(--fg)); }
.att-card__glyph--pdf { background: color-mix(in srgb, #ff6b6b 14%, transparent); color: color-mix(in srgb, #ff6b6b 55%, var(--fg)); }
.att-card__glyph--text { background: color-mix(in srgb, #4aa3ff 15%, transparent); color: color-mix(in srgb, #4aa3ff 55%, var(--fg)); }
.att-card__glyph.is-dead { opacity: .5; }
.att-card--dead { opacity: .62; border-style: dashed; }
.att-card--dead b { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 55%, transparent); text-decoration-thickness: 1.5px; }
.att-card__act {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px; flex: none; color: var(--faint);
  transition: all .18s; cursor: pointer;
}
.att-card__act:hover { color: var(--fg); background: var(--hover); }
.att-card__act svg { width: 14px; height: 14px; }
.att-card__act--go { background: color-mix(in srgb, var(--acc) 14%, transparent); color: var(--acc); }
.att-card__act--go:hover { background: color-mix(in srgb, var(--acc) 26%, transparent); color: var(--acc); }
@media (max-width: 860px) {
  .atts { padding: 10px 14px 2px; }
  .att-card__meta b { max-width: 150px; }
}

/* ---------- v3.2.6 — the video card wears a real frame ---------- */
.att-card--video { position: relative; overflow: hidden; }
.att-card__thumb--video {
  pointer-events: none; background: #0a0d0a; object-fit: cover;
}
.att-card__playflag {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, #060a08 62%, transparent);
  color: #fff; backdrop-filter: blur(4px);
  box-shadow: 0 4px 14px -4px rgba(0,0,0,.6);
  pointer-events: none;
}
.att-card__playflag svg { width: 13px; height: 13px; fill: currentColor; stroke: none; margin-inline-start: 1px; }
.att-card__meta--over {
  position: absolute; inset-inline: 6px; bottom: 6px;
  padding: 5px 8px; border-radius: 9px;
  background: linear-gradient(0deg, color-mix(in srgb, #060a08 78%, transparent), transparent);
  color: #fff; pointer-events: none;
}
.att-card__meta--over b { color: #fff; max-width: 100%; }
.att-card__meta--over .faint { color: #ffffffb8; }
.att-card__act--corner {
  position: absolute; top: 8px; inset-inline-end: 8px;
  width: 28px; height: 28px; border-radius: 9px;
  background: color-mix(in srgb, #060a08 62%, transparent);
  color: #fff; backdrop-filter: blur(4px);
}
.att-card__act--corner:hover { color: #fff; background: color-mix(in srgb, #060a08 78%, transparent); }

/* ---------- the lightbox: a letter's pictures, edge to edge ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 900; display: flex; flex-direction: column;
  background: color-mix(in srgb, #060a08 88%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; transition: opacity .24s var(--ease);
}
.lightbox.is-in { opacity: 1; }
.lightbox__stage { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 26px; cursor: zoom-in; min-height: 0; touch-action: none; }
.lightbox__frame { max-width: 100%; max-height: 100%; display: flex; }
.lightbox__img { max-width: 100%; max-height: calc(100svh - 120px); object-fit: contain; border-radius: 10px; box-shadow: 0 22px 70px -22px rgba(0,0,0,.75); transition: transform .25s var(--spring), opacity .2s var(--ease); will-change: transform; }
.lightbox__img.is-live { transition: opacity .2s var(--ease); }
.lightbox__img.is-zoom { cursor: zoom-out; }
.lightbox__bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-top: 1px solid var(--stroke); background: color-mix(in srgb, var(--panel) 82%, transparent);
  color: var(--fg);
}
.lightbox__name { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.lightbox__counter { font-size: 11.5px; color: var(--faint); flex: none; }
.lightbox__close { margin-inline-start: 0; }
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--panel) 76%, transparent); border: 1px solid var(--stroke);
  color: var(--fg); cursor: pointer; transition: all .2s; z-index: 2;
}
.lightbox__nav:hover { background: var(--panel-2); border-color: var(--acc); }
.lightbox__nav svg { width: 17px; height: 17px; }
.lightbox__nav--prev { inset-inline-start: 14px; }
.lightbox__nav--next { inset-inline-end: 14px; }
.lightbox { position: fixed; }
.lightbox .lightbox__nav { position: fixed; }

/* ---------- the attachment viewer (video / pdf / text) ---------- */
.attview .modal__body { padding: 12px 16px 16px; }
.attview__video { width: 100%; max-height: 62svh; border-radius: 12px; background: #000; display: block; }
.attview__pdf { width: 100%; height: min(66svh, 560px); border: 1px solid var(--stroke); border-radius: 12px; background: #171b17; }
.attview__text {
  margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--field);
  max-height: min(60svh, 520px); overflow: auto; font-size: 12.5px; line-height: 1.8;
  white-space: pre-wrap; word-break: break-word;
}

/* ---------- the Cmail audio player (v3.2.6 — the Climind-W window) ----------
   The bar hangs from the TOP edge, under the pill bar, and descends with a
   spring. Its identity block is the expand key: tapping it unfolds the full
   player window — a spinning artwork disc, a thumb-wide rail with the comet
   knob, the queue, every control. The seek is commit-on-release: the finger
   drags a preview, the stream moves once on the release, the paint loop is a
   rAF clock. Logical properties everywhere, so RTL mirrors for free. */
.cmplayer {
  position: fixed; top: calc(var(--shell-top, 76px) - 2px); inset-inline: 12px; z-index: 760;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 18px;
  /* a mostly-solid mood surface — the player floats over the white letter
     body too, and pure glass goes light-on-light there (v3.2.2 walkthrough) */
  background: color-mix(in srgb, var(--bg) 93%, var(--panel-3));
  border: 1px solid color-mix(in srgb, var(--acc) 26%, var(--stroke));
  box-shadow: var(--shadow), 0 18px 50px -18px color-mix(in srgb, var(--acc) 40%, rgba(0,0,0,.5));
  -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5);
  transform: translateY(-150%) scale(.97); opacity: 0;
  transition: transform .5s cubic-bezier(.22,1.45,.36,1), opacity .3s var(--ease);
  max-width: 760px; margin-inline: auto;
  overflow: hidden; isolation: isolate;
}
.cmplayer.is-in { transform: translateY(0) scale(1); opacity: 1; }
/* while the full window is open the bar steps back — same song, quieter face */
.cmplayer.is-behind { opacity: .0; pointer-events: none; }
/* v3.2.3 — the Climind aurora: two slow hues breathing behind the glass,
   waking up the moment the music plays */
.cmplayer::before {
  content: ''; position: absolute; inset: -42%; z-index: -1;
  background:
    radial-gradient(42% 55% at 22% 60%, color-mix(in srgb, var(--acc) 34%, transparent), transparent 70%),
    radial-gradient(38% 50% at 76% 30%, color-mix(in srgb, #7c6cff 26%, transparent), transparent 72%);
  filter: blur(14px);
  opacity: .3; transform: rotate(0deg) scale(1);
  transition: opacity .6s var(--ease);
  animation: cmAurora 14s linear infinite;
}
.cmplayer.is-playing::before { opacity: .62; }
@keyframes cmAurora {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.14); }
  100% { transform: rotate(360deg) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .cmplayer::before { animation: none; }
}
.cmplayer__play {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--acc-l, var(--acc)), var(--acc-d, var(--acc)));
  color: #0d130d; border: 0; cursor: pointer; transition: transform .18s var(--spring), filter .2s;
}
.cmplayer__play:hover { transform: scale(1.07); filter: brightness(1.08); }
.cmplayer__play:active { transform: scale(.92); }
.cmplayer__play svg { width: 15px; height: 15px; fill: currentColor; stroke: none; }
/* the two glyphs swap with the state — !important wins over icon()'s inline display */
.cmplayer__play .icn:nth-child(2) { display: none !important; }
.cmplayer__play.is-playing .icn:nth-child(1) { display: none !important; }
.cmplayer__play.is-playing .icn:nth-child(2) { display: inline-flex !important; }
/* the opener: equalizer + title + counter as ONE expand key */
.cmplayer__opener {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0;
  flex: 0 1 auto; padding: 2px; border: 0; background: transparent; cursor: pointer;
  border-radius: 10px; text-align: start; color: inherit; font: inherit;
}
.cmplayer__opener:hover .cmplayer__t b { color: var(--acc); }
.cmplayer__t { display: flex; flex-direction: column; min-width: 0; max-width: 220px; line-height: 1.3; }
.cmplayer__t b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .2s; }
.cmplayer__sub { font-size: 10.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* v3.2.3 — the dancing equalizer: four bars that breathe with the sound,
   and stand still (honest, dimmed) the moment the music stops */
.cmplayer__eq {
  display: inline-flex; align-items: flex-end; gap: 2.5px; height: 16px; flex: none;
}
.cmplayer__eq i {
  width: 3px; height: 24%; border-radius: 2px; background: var(--acc); opacity: .4;
  transform-origin: bottom; transition: opacity .3s;
}
.cmplayer.is-playing .cmplayer__eq i { opacity: .95; animation: cmEq 1.05s ease-in-out infinite; }
.cmplayer.is-playing .cmplayer__eq i:nth-child(1) { animation-delay: 0s; height: 55%; }
.cmplayer.is-playing .cmplayer__eq i:nth-child(2) { animation-delay: .18s; height: 90%; }
.cmplayer.is-playing .cmplayer__eq i:nth-child(3) { animation-delay: .09s; height: 40%; }
.cmplayer.is-playing .cmplayer__eq i:nth-child(4) { animation-delay: .27s; height: 70%; }
@keyframes cmEq {
  0%, 100% { transform: scaleY(.35); }
  35%      { transform: scaleY(1.12); }
  62%      { transform: scaleY(.55); }
}
@media (prefers-reduced-motion: reduce) {
  .cmplayer.is-playing .cmplayer__eq i { animation: none; }
}
/* v3.2.3 — the playlist steps and the track counter */
.cmplayer__step {
  flex: none; width: 24px; height: 24px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; color: var(--faint); cursor: pointer; transition: all .16s;
}
.cmplayer__step:hover { color: var(--acc); background: var(--hover); }
.cmplayer__step:active { transform: scale(.9); }
.cmplayer__step svg { width: 12px; height: 12px; }
.cmplayer__count { font-size: 10px; color: var(--faint); flex: none; }
/* v3.2.3 — the volume rail (folds away on narrow phones) */
.cmplayer__vol {
  flex: none; width: 62px; height: 14px; cursor: pointer;
  accent-color: var(--acc); background: transparent;
}
.cmplayer__vol.is-mute { opacity: .5; }
/* v3.2.3 — the honest buffering pulse while the song finds its bytes */
.cmplayer.is-buffer .cmplayer__play,
.cmx.is-buffer .cmx__play {
  animation: cmBuffer 1.1s ease-in-out infinite;
}
@keyframes cmBuffer {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--acc) 45%, transparent); }
  50%      { box-shadow: 0 0 0 7px transparent; }
}
/* the rail: wave track, buffered trail, glowing comet knob — one factory
   wires every rail (bar + window) to the same commit-on-release gesture */
.cmplayer__rail {
  flex: 1; height: 24px; display: flex; align-items: center; cursor: pointer; min-width: 80px;
  position: relative; border-radius: 8px; touch-action: none;
}
.cmplayer__rail::before {
  content: ''; position: absolute; inset-inline: 0; height: 5px; border-radius: 4px;
  background: repeating-linear-gradient(90deg, var(--field) 0 3px, transparent 3px 5px);
}
.cmplayer__wave {
  position: absolute; inset-inline: 0; height: 5px; border-radius: 4px; overflow: hidden;
}
.cmplayer__wave::after {
  content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--buf, 0%);
  background: color-mix(in srgb, var(--fg) 14%, transparent); border-radius: 4px;
  transition: width .3s var(--ease);
}
.cmplayer__fill {
  position: absolute; inset-inline-start: 0; height: 5px; border-radius: 4px; width: 0%;
  background: linear-gradient(90deg, var(--acc), color-mix(in srgb, var(--acc) 55%, #b8ffdd));
  box-shadow: 0 0 12px -2px color-mix(in srgb, var(--acc) 70%, transparent);
}
.cmplayer__knob {
  position: absolute; top: 50%; inset-inline-start: 0%; width: 11px; height: 11px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 38%, transparent), 0 1px 6px rgba(0,0,0,.45);
  opacity: .95; transition: box-shadow .2s;
}
[dir='rtl'] .cmplayer__knob { transform: translate(50%, -50%); }
.cmplayer__rail:active .cmplayer__knob,
.cmplayer__rail:focus-visible .cmplayer__knob { box-shadow: 0 0 0 5px color-mix(in srgb, var(--acc) 45%, transparent), 0 1px 8px rgba(0,0,0,.5); }
.cmplayer__time { font-size: 10.5px; color: var(--faint); flex: none; }
.cmplayer__speed {
  flex: none; font-size: 10.5px; font-weight: 700; padding: 5px 9px; border-radius: 9px;
  background: var(--field); border: 1px solid var(--stroke); color: var(--fg); cursor: pointer; transition: all .18s;
}
.cmplayer__speed:hover { color: var(--acc); border-color: color-mix(in srgb, var(--acc) 40%, transparent); }
.cmplayer__dl { color: var(--faint); text-decoration: none; }
.cmplayer__dl:hover { color: var(--fg); background: var(--hover); }
.cmplayer__expand { color: var(--faint); }
.cmplayer__expand:hover { color: var(--acc); background: var(--hover); }
.cmplayer__expand svg { width: 14px; height: 14px; }

/* v3.2.6 mobile rethink — on phones the card folds into two rows that hang
   from the top: row 1 carries the play key, the opener (equalizer + song +
   artist) and the quick actions; row 2 hands the seek a full thumb-wide wave. */
@media (max-width: 700px), (max-width: 960px) and (max-height: 480px) {
  .cmplayer {
    top: calc(var(--shell-top, 66px) + 2px); inset-inline: 10px;
    flex-wrap: wrap; column-gap: 8px; row-gap: 0;
    padding: 10px 12px 11px; border-radius: 20px; max-width: none;
  }
  /* row 1 — the identity line */
  .cmplayer__play { order: 1; width: 44px; height: 44px; }
  .cmplayer__play svg { width: 17px; height: 17px; }
  .cmplayer__opener { order: 2; flex: 1 1 12px; }
  .cmplayer__t { max-width: none; flex: 1 1 auto; }
  .cmplayer__t b { font-size: 13px; }
  .cmplayer__sub { display: block; font-size: 10.5px; }  /* the artist line rides along again */
  .cmplayer__dl { order: 3; width: 38px; height: 38px; }
  .cmplayer__expand { order: 4; width: 38px; height: 38px; }
  .cmplayer > .icon-btn:not(.cmplayer__dl):not(.cmplayer__expand) { order: 5; width: 38px; height: 38px; }  /* close */
  .cmplayer__speed { order: 6; height: 38px; padding-block: 0; padding-inline: 10px; }
  /* row 2 — the thumb line: the playlist steps flank the wide wave */
  .cmplayer__rail { order: 7; flex: 1 1 calc(100% - 190px); min-width: 0; height: 30px; margin-top: 3px; }
  .cmplayer__step { order: 8; width: 30px; height: 30px; border-radius: 9px; }
  .cmplayer__step svg { width: 14px; height: 14px; }
  .cmplayer__time { order: 9; }
  .cmplayer__step--next { order: 10; }
  /* the counter and the volume fold away — hardware keys own loudness and
     the steps themselves tell which song is on */
  .cmplayer__count, .cmplayer__vol { display: none; }
}

/* ---------- the expanded window (the Climind-W full player) ---------- */
.cmx-stage {
  position: fixed; inset: 0; z-index: 780;
  display: flex; align-items: flex-start; justify-content: center;
  padding: calc(var(--shell-top, 76px) + 8px) 14px 24px;
  pointer-events: none;
}
.cmx-back {
  position: absolute; inset: 0; pointer-events: auto;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2);
  opacity: 0; transition: opacity .32s var(--ease);
}
.cmx {
  pointer-events: auto; position: relative;
  width: min(420px, 100%); max-height: calc(100svh - var(--shell-top, 76px) - 28px);
  overflow: auto; overscroll-behavior: contain;
  border-radius: 26px; padding: 22px 22px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  background: color-mix(in srgb, var(--bg) 88%, var(--panel-3));
  border: 1px solid color-mix(in srgb, var(--acc) 28%, var(--stroke));
  box-shadow: var(--shadow), 0 34px 90px -24px color-mix(in srgb, var(--acc) 45%, rgba(0,0,0,.55));
  -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
  transform-origin: 50% 0;
  transform: translateY(-26px) scale(.9);
  opacity: 0;
  transition: transform .44s cubic-bezier(.22,1.4,.36,1), opacity .28s var(--ease);
  isolation: isolate; overflow: hidden;
}
.cmx.is-in { transform: translateY(0) scale(1); opacity: 1; }
.cmx-stage.is-in .cmx-back { opacity: 1; }
/* the artwork disc: a vinyl that spins while the sound flows */
.cmx__disc {
  width: 148px; height: 148px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--acc) 52%, #ffffff10), transparent 58%),
    conic-gradient(from 210deg, var(--acc-d, var(--acc)), var(--acc), color-mix(in srgb, var(--acc) 40%, #14190f), var(--acc-d, var(--acc)));
  box-shadow: 0 18px 44px -14px color-mix(in srgb, var(--acc) 55%, transparent), inset 0 0 0 1px color-mix(in srgb, #ffffff14, transparent);
  animation: cmSpin 9s linear infinite;
  animation-play-state: paused;
}
.cmx.is-playing .cmx__disc { animation-play-state: running; }
@keyframes cmSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cmx__disc { animation: none; } }
.cmx__groove {
  position: absolute; width: 108px; height: 108px; border-radius: 50%;
  background: repeating-radial-gradient(circle, #ffffff0a 0 2px, transparent 2px 5px);
}
.cmx__hole {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 82%, var(--panel-3));
  color: var(--acc);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--acc) 30%, var(--stroke));
}
.cmx__hole svg { width: 20px; height: 20px; }
.cmx__title { font-size: 15px; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmx__sub { font-size: 11.5px; color: var(--faint); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmx__railrow { display: flex; align-items: center; gap: 9px; width: 100%; }
.cmx__clock, .cmx__remain { font-size: 10.5px; color: var(--faint); flex: none; min-width: 38px; }
.cmx__remain { text-align: end; }
.cmx__ctrls { display: flex; align-items: center; gap: 22px; margin-top: 2px; }
.cmx__step {
  width: 40px; height: 40px; border-radius: 14px; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--field); color: var(--fg); transition: all .18s var(--spring);
}
.cmx__step:hover { color: var(--acc); background: var(--hover); transform: translateY(-1px); }
.cmx__step:active { transform: scale(.92); }
.cmx__step svg { width: 16px; height: 16px; }
.cmx__play {
  width: 62px; height: 62px; border-radius: 50%; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--acc-l, var(--acc)), var(--acc-d, var(--acc)));
  color: #0d130d;
  box-shadow: 0 14px 30px -10px color-mix(in srgb, var(--acc) 65%, transparent);
  transition: transform .18s var(--spring), filter .2s;
}
.cmx__play:hover { transform: scale(1.06); filter: brightness(1.08); }
.cmx__play:active { transform: scale(.9); }
.cmx__play svg { width: 24px; height: 24px; fill: currentColor; stroke: none; }
.cmx__play .icn:nth-child(2) { display: none !important; }
.cmx.is-playing .cmx__play .icn:nth-child(1) { display: none !important; }
.cmx.is-playing .cmx__play .icn:nth-child(2) { display: inline-flex !important; }
.cmx__tools { display: flex; align-items: center; gap: 12px; width: 100%; justify-content: center; }
.cmx__vol { width: 110px; accent-color: var(--acc); background: transparent; cursor: pointer; }
.cmx__vol.is-mute { opacity: .5; }
.cmx__speed {
  font-size: 11px; font-weight: 700; padding: 6px 11px; border-radius: 10px;
  background: var(--field); border: 1px solid var(--stroke); color: var(--fg); cursor: pointer; transition: all .18s;
}
.cmx__speed:hover { color: var(--acc); border-color: color-mix(in srgb, var(--acc) 40%, transparent); }
/* the collapse key floats at the window's top corner */
.cmx > .icon-btn { position: absolute; top: 12px; inset-inline-end: 12px; }
.cmx > .icon-btn svg { transform: rotate(0deg); }
/* the queue: the letter's audios, the playing one lit */
.cmx__queue { width: 100%; margin-top: 2px; }
.cmx__qhead { padding: 8px 4px 4px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.cmx__qhead b { font-size: 12px; }
.cmx__qlist { display: flex; flex-direction: column; gap: 3px; max-height: 168px; overflow: auto; }
.cmx__qrow {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 10px; border-radius: 12px; border: 0; cursor: pointer;
  background: transparent; color: var(--fg); font: inherit; text-align: start;
  transition: background .16s;
}
.cmx__qrow:hover { background: var(--hover); }
.cmx__qrow.is-now { background: color-mix(in srgb, var(--acc) 14%, transparent); }
.cmx__qnum { font-size: 10.5px; color: var(--faint); flex: none; min-width: 18px; }
.cmx__qname { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmx__qrow.is-now .cmx__qname { color: var(--acc); }
.cmx__qeq { display: none; align-items: flex-end; gap: 2px; height: 12px; flex: none; }
.cmx__qeq i { width: 2.5px; border-radius: 2px; background: var(--acc); transform-origin: bottom; }
.cmx__qrow.is-now .cmx__qeq { display: inline-flex; }
.cmx.is-playing .cmx__qeq i { animation: cmEq 1.05s ease-in-out infinite; }
.cmx.is-playing .cmx__qeq i:nth-child(1) { height: 60%; animation-delay: 0s; }
.cmx.is-playing .cmx__qeq i:nth-child(2) { height: 100%; animation-delay: .15s; }
.cmx.is-playing .cmx__qeq i:nth-child(3) { height: 45%; animation-delay: .3s; }
@media (prefers-reduced-motion: reduce) { .cmx.is-playing .cmx__qeq i { animation: none; } }
/* the window on small phones: full width, tall disc stays humble */
@media (max-width: 480px) {
  .cmx-stage { padding: calc(var(--shell-top, 66px) + 6px) 10px 16px; }
  .cmx { border-radius: 24px; padding: 20px 16px 14px; }
  .cmx__disc { width: 128px; height: 128px; }
}
@media (max-height: 620px) {
  .cmx__disc { width: 96px; height: 96px; }
  .cmx__queue { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cmplayer, .cmx, .cmx-back { transition-duration: .01s; }
}

/* ---------- the storage fuel gauge (settings → general) ---------- */
.st-card { display: flex; flex-direction: column; gap: 13px; }
.st-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.st-card--low { border-color: color-mix(in srgb, var(--warn) 34%, transparent); }
.st-card--full { border-color: color-mix(in srgb, var(--danger) 44%, transparent); }
.st-warn {
  display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border-radius: 12px;
  font-size: 12.5px; line-height: 1.65; font-weight: 600;
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 36%, transparent);
  color: color-mix(in srgb, var(--warn) 72%, var(--fg));
  animation: alert-in .35s var(--ease) both;
}
.st-warn svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.st-warn--full { background: color-mix(in srgb, var(--danger) 10%, transparent); border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: color-mix(in srgb, var(--danger) 76%, var(--fg)); }
.st-gauge { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.st-ring { width: 82px; height: 82px; flex: none; }
.st-ring--ok { color: var(--acc); }
.st-ring--low { color: var(--warn); }
.st-ring--full { color: var(--danger); }
.st-gauge__n { font-size: 14px; }
.st-gauge__n b { font-size: 21px; letter-spacing: -.3px; }
.st-gauge__meta { display: flex; gap: 14px; font-size: 12px; color: var(--faint); margin-top: 3px; }
.st-bar { display: flex; width: 100%; height: 9px; border-radius: 6px; overflow: hidden; margin-top: 10px; gap: 2px; }
.st-bar__seg { display: block; height: 100%; border-radius: 3px; min-width: 6px; transition: width .4s var(--ease); }
.k-body    { background: #58b380; }
.k-image   { background: #6aa6e8; }
.k-video   { background: #9b86f0; }
.k-audio   { background: #e8a44a; }
.k-pdf     { background: #e86565; }
.k-doc     { background: #56b8c9; }
.k-archive { background: #b8b094; }
.k-other   { background: #8a9490; }
.st-kinds { display: flex; flex-direction: column; gap: 2px; }
.st-kind {
  display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 9px; font-size: 12.5px;
}
.st-kind:hover { background: var(--hover); }
.st-kind__icn {
  display: inline-flex; width: 26px; height: 26px; border-radius: 8px; flex: none;
  align-items: center; justify-content: center; color: #dfe7df;
}
.st-kind__icn svg { width: 13px; height: 13px; }
.st-kind__pct { min-width: 34px; text-align: end; }
.st-controls { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--stroke); padding-top: 11px; }
.st-last { display: flex; align-items: center; gap: 6px; padding: 2px 4px; }
.st-last svg { width: 13px; height: 13px; flex: none; }
.st-big { border-top: 1px solid var(--stroke); padding-top: 9px; }
.st-big__t { margin-bottom: 5px; padding: 0 4px; font-weight: 700; }
.st-big__row {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 9px; font-size: 12.5px;
}
.st-big__row:hover { background: var(--hover); }
.st-big__subj { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* v3.2.3 — the fuel gauge learns to move: the ring draws itself in, the
   segmented bar grows from zero, every kind row carries its own live mini
   rail, the state glow breathes behind the card and a full disk PULSES. */
.st-card { position: relative; overflow: hidden; isolation: isolate; }
.st-card::before {
  content: ''; position: absolute; inset: -30% -18% auto; height: 130px; z-index: -1;
  background: radial-gradient(46% 74% at 30% 0%, color-mix(in srgb, var(--acc) 20%, transparent), transparent 74%);
  filter: blur(10px); opacity: .55;
  animation: stGlow 7s ease-in-out infinite;
}
.st-card--low::before { background: radial-gradient(46% 74% at 30% 0%, color-mix(in srgb, var(--warn) 24%, transparent), transparent 74%); }
.st-card--full::before { background: radial-gradient(46% 74% at 30% 0%, color-mix(in srgb, var(--danger) 28%, transparent), transparent 74%); }
@keyframes stGlow {
  0%, 100% { opacity: .4; transform: translateY(0); }
  50%      { opacity: .75; transform: translateY(6px); }
}
.st-card--full::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent); border-radius: inherit;
  animation: stPulse 2s ease-in-out infinite;
}
@keyframes stPulse {
  0%, 100% { opacity: .15; }
  50%      { opacity: .75; }
}
@media (prefers-reduced-motion: reduce) {
  .st-card::before, .st-card--full::after { animation: none; }
}
/* the ring draws itself in on mount (JS sets the target offset one frame later) */
.st-ring circle { transition: stroke-dashoffset 1.1s var(--ease); }
/* the segmented bar grows from zero once the card mounts */
.st-bar__seg { transition: width .8s var(--ease); }
.st-card:not(.is-mounted) .st-bar__seg { width: 0% !important; min-width: 0; }
/* every kind row: its own mini rail that fills with the kind's color */
.st-kind { position: relative; padding-bottom: 9px; }
.st-kind__mini {
  position: absolute; inset-inline: 4px; bottom: 3px; height: 3px; border-radius: 3px;
  background: var(--field); overflow: hidden; opacity: .9;
}
.st-kind__mini i {
  display: block; height: 100%; border-radius: 3px; width: 0%;
  transition: width .9s var(--ease);
}
.st-card.is-mounted .st-kind__mini i { width: var(--w, 0%); }
.st-kind:hover .st-kind__icn { transform: scale(1.12); }
.st-kind__icn { transition: transform .18s var(--spring); }
/* the warning strip keeps breathing while the disk is tight */
.st-warn--full { animation: stWarnPulse 2.4s ease-in-out infinite; }
@keyframes stWarnPulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 0%, transparent); }
  50%      { box-shadow: 0 0 0 5px color-mix(in srgb, var(--danger) 14%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .st-warn--full { animation: none; }
  .st-ring circle, .st-bar__seg, .st-kind__mini i { transition: none; }
}
/* the one-press cleanup earns its own busy spinner */
.st-clean.is-busy { pointer-events: none; opacity: .7; }
.st-clean.is-busy .icn { animation: spinOnce .9s linear infinite; }

/* ---------- the compose attachment meter ---------- */
.compose__meter { display: flex; align-items: center; gap: 8px; padding: 4px 2px 0; }
.compose__meter-rail { flex: 1; height: 4px; border-radius: 4px; background: var(--field); overflow: hidden; display: block; }
.compose__meter-fill { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--acc), color-mix(in srgb, var(--acc) 55%, #b8ffdd)); transition: width .3s var(--ease); }
.compose__meter-fill.is-hot { background: var(--danger); }

/* ============================================================
   v3.2.5 — the new furniture: undo toasts, the older-mail
   sentinel, mark-all chip, Cc/Bcc fold, player-aware chrome,
   two premium palettes, and a print safety net
   ============================================================ */

/* the undo action rides inside the toast (delete · Undo) */
.toast__act {
  flex: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 800; letter-spacing: .2px;
  color: var(--acc); padding: 4px 10px; border-radius: 99px;
  transition: background .16s var(--ease);
}
.toast__act:hover { background: var(--acc-soft); }

/* the older-mail sentinel at the bottom of the inbox */
.list-more {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 6px 12px 14px; padding: 11px 14px;
  border: 1px dashed var(--stroke-2); border-radius: 14px;
  background: transparent; color: var(--muted);
  font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.list-more:hover { color: var(--fg); border-color: var(--acc-line); background: var(--hover); }
.list-more .spin--inline svg { width: 13px; height: 13px; }

/* the mark-all chip in the inbox toolbar */
.inbox-bar__markall {
  flex: none; padding: 4px 10px; font-size: 11px; min-height: 0;
  border-color: var(--stroke-2); color: var(--muted);
}
.inbox-bar__markall:hover { color: var(--acc); border-color: var(--acc-line); }
.inbox-bar__markall svg { width: 12px; height: 12px; }

/* the Cc/Bcc chip + its folded rows */
.compose__ccbtn {
  flex: none; padding: 4px 10px; font-size: 11px; min-height: 0; font-weight: 700;
  border-color: var(--stroke-2); color: var(--muted); align-self: center;
}
.compose__ccbtn:hover { color: var(--acc); border-color: var(--acc-line); }
.compose__line--cc .compose__k { color: var(--muted); }

/* v3.2.6 — the player hangs from the TOP edge now, so the FAB and the
   toasts keep their floor-level seats: no more climbing above the bar. */

/* the keyboard writes its own height — iOS keeps the layout viewport on
   focus, so the bottom-anchored composer sheet pads itself up */
body.has-kb .modal--compose { padding-bottom: var(--kb-h, 0px); }

/* two premium palettes — same var shape as the twelve before them */
html[data-accent='orchid'] { --acc-l: #d7a6ee; --acc-d: #9d4fc0; --acc-ink: #230f2e; --mood-bg: #1a121f; --mood-bg-l: #f7f0fa; }
html[data-accent='sand']   { --acc-l: #e3c79a; --acc-d: #a8813f; --acc-ink: #2a1f0e; --mood-bg: #1e1812; --mood-bg-l: #f9f5ec; }

/* Ctrl/Cmd+P on the app itself prints the LETTER, never the glass chrome —
   the real print pipeline (the studio iframe) is untouched by this net */
@media print {
  .pillbar, .tabbar, .toasts, .cmplayer, .bg-stage, .compose-fab, .loadbar,
  .sysalert-wrap, .cmdk-back, .modal-back, .mail__scrim, .acct-menu, .ctxmenu,
  .dyn-island, .fab-shell, .auth-ctrls, .share-island {
    display: none !important;
  }
  html, body { background: #fff !important; color: #111 !important; }
  .view { padding: 0 !important; }
  .glass, .card { box-shadow: none !important; backdrop-filter: none !important; background: #fff !important; border-color: #ddd !important; }
  .bg-glow, .bg-stage * { display: none !important; }
}

/* v3.2.5 — the settings section rail: sidebar on the desktop, chips on phones */
.settings-shell { display: block; }
.settings-rail { display: none; }
.settings-desc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.settings-desc-row .page-sub { margin: 0; }
.settings-reset { flex: none; }
.settings-nomatch { padding: 10px 2px; }
@media (min-width: 861px) {
  .settings-shell {
    display: grid;
    grid-template-columns: minmax(210px, 248px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
  }
  .settings-rail-col {
    position: sticky;
    top: calc(var(--shell-top, 76px) + 8px);
    display: flex; flex-direction: column; gap: 10px;
  }
  .settings-rail {
    display: flex; flex-direction: column; gap: 4px;
    padding: 8px;
    background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius-lg);
    -webkit-backdrop-filter: blur(var(--blur-2, 14px)); backdrop-filter: blur(var(--blur-2, 14px));
  }
  .settings-rail__item {
    display: flex; align-items: flex-start; gap: 10px; text-align: start;
    padding: 9px 10px; border-radius: 13px; border: 0; cursor: pointer;
    background: transparent; color: var(--muted); font: inherit;
    transition: background .18s var(--ease), color .18s var(--ease);
  }
  .settings-rail__item:hover { background: var(--hover); color: var(--fg); }
  .settings-rail__item.is-on { background: var(--acc-soft); color: var(--fg); }
  .settings-rail__icn { flex: none; width: 18px; height: 18px; margin-top: 2px; }
  .settings-rail__icn svg { width: 16px; height: 16px; }
  .settings-rail__txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
  .settings-rail__txt b { font-size: 13px; font-weight: 750; }
  .settings-rail__d { font-size: 10.5px; line-height: 1.45; color: var(--faint); }
  .settings-rail__item.is-on .settings-rail__d { color: var(--muted); }
}
