/* Splash Mail webmail. Same visual language as the home and plan pages:
   near-black canvas, Plus Jakarta Sans, gradient cards lit by the product
   colour (Splash Mail blue), pill buttons and light, tight headings. */
:root {
  --bg: #060608;
  --panel: #0b0b0e;
  --card-a: #1b1b20;
  --card-b: #111114;
  --line: #ffffff12;
  --line-2: #ffffff25;
  --text: #b9bbc5;
  --dim: #8d8d99;
  --white: #fff;
  --product-rgb: 70 185 242;
  --lime: #c6ff3d;
  --danger: #ff6b6b;
  --radius: 22px;
  --radius-md: 14px;
  --ease: cubic-bezier(.4, 0, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 400 14px/1.55 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid rgb(var(--product-rgb)); outline-offset: 2px; border-radius: 8px; }
::selection { background: rgb(var(--product-rgb) / .35); color: #fff; }
* { scrollbar-width: thin; scrollbar-color: #ffffff22 transparent; }

.icon { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- buttons */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 42px; padding: 0 20px; border-radius: 999px;
  border: 1px solid #ffffffa6; background: transparent; color: #fff;
  font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.pill:hover, .pill:focus-visible { background: #fff; color: #000; }
.pill.solid { background: #fff; color: #000; border-color: #fff; }
.pill.solid:hover { background: #e9e9ee; }
.pill.ghost { border-color: var(--line-2); color: var(--text); font-weight: 600; }
.pill.ghost:hover { background: #ffffff10; color: #fff; }
.pill.small { min-height: 34px; padding: 0 14px; font-size: 12px; gap: 8px; }
.pill:disabled { opacity: .5; pointer-events: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 999px; border: 1px solid transparent;
  background: transparent; color: var(--text);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.icon-btn:hover { background: #ffffff10; color: #fff; }
.icon-btn.active { color: var(--lime); }

/* ------------------------------------------------------------------ login */
.wm-backdrop {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background: radial-gradient(ellipse at 72% 28%, rgb(var(--product-rgb) / .22), transparent 62%);
}
.wm-backdrop img {
  position: absolute; right: -6%; top: 6%; width: min(72vw, 960px); height: 80vh; object-fit: contain;
  opacity: .2; mix-blend-mode: screen;
  filter: saturate(.9) brightness(1.3);
  mask-image: radial-gradient(ellipse, #000 40%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse, #000 40%, transparent 72%);
}
.wm-login {
  /* The site nav (shared header, spacer --sn-nav-height) sits above. */
  min-height: calc(100dvh - var(--sn-nav-height, 68px)); display: grid; grid-template-rows: 1fr auto;
  max-width: 1264px; margin: 0 auto; padding: 0 32px;
}
.wm-brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-size: 18px; font-weight: 700; }
.wm-brand img { width: 34px; height: 34px; object-fit: contain; }
.wm-brand small { font-size: 12px; font-weight: 600; color: var(--dim); letter-spacing: .02em; }
.wm-login-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 64px; align-items: center; padding: 40px 0 80px; }
.eyebrow { display: block; font-size: 11px; letter-spacing: .13em; font-weight: 600; color: #b8bac3; margin-bottom: 18px; text-transform: uppercase; }
.wm-login h1 {
  font-size: clamp(44px, 6vw, 82px); line-height: 1.04; letter-spacing: -.045em; font-weight: 600;
  color: #fff; margin: 0 0 24px;
}
.wm-login-lede { font-size: 19px; line-height: 1.65; max-width: 520px; color: #c0c0ca; margin: 0; }
.card {
  position: relative; border: 1px solid var(--line-2); border-radius: var(--radius);
  background:
    radial-gradient(ellipse at top right, rgb(var(--product-rgb) / .2), transparent 70%),
    linear-gradient(140deg, var(--card-a), var(--card-b));
  box-shadow: 0 20px 50px rgb(var(--product-rgb) / .08), 0 30px 60px #00000070;
}
.wm-login-card { padding: 36px; }
.wm-login-card h2 { margin: 0 0 6px; font-size: 26px; font-weight: 500; letter-spacing: -.03em; color: #fff; }
.wm-login-card p.muted { margin: 0 0 26px; font-size: 13px; color: var(--dim); }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 12px; font-weight: 600; color: #aaaab7; }
.input {
  width: 100%; height: 50px; padding: 0 18px; border-radius: 14px;
  border: 1px solid var(--line-2); background: #0d0d10; color: #fff;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.input:focus { outline: none; border-color: rgb(var(--product-rgb) / .8); box-shadow: 0 0 0 4px rgb(var(--product-rgb) / .15); }
.wm-login-card .pill { width: 100%; margin-top: 8px; min-height: 50px; font-size: 14px; }
.form-error { min-height: 20px; margin: 14px 0 0; font-size: 13px; color: var(--danger); }
.wm-login-foot { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding: 24px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--dim); }
.wm-login-foot a { color: var(--dim); text-decoration: none; }
.wm-login-foot a:hover { color: #fff; }

/* -------------------------------------------------------------------- app */
.wm-app { height: 100dvh; display: grid; grid-template-rows: 64px minmax(0, 1fr); overflow: hidden; }
.wm-top {
  display: flex; align-items: center; gap: 18px; padding: 0 18px;
  border-bottom: 1px solid var(--line); background: #08080bcc; backdrop-filter: blur(18px) saturate(140%);
  /* The blur makes this bar its own layer; without a z-index the message rows paint
     over the account menu and take its taps. Stays under the side-menu scrim (25). */
  position: relative; z-index: 20;
}
.wm-top .wm-brand { min-width: 212px; }
.wm-menu-btn { display: none; }
.wm-search { position: relative; flex: 1; max-width: 640px; }
.wm-search .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--dim); pointer-events: none; }
.wm-search input {
  width: 100%; height: 42px; padding: 0 44px 0 44px; border-radius: 999px;
  border: 1px solid var(--line); background: #121216; color: #fff;
}
.wm-search input:focus { outline: none; border-color: rgb(var(--product-rgb) / .7); }
.wm-search input::placeholder { color: var(--dim); }
.wm-search .icon-btn { position: absolute; right: 3px; top: 2px; width: 38px; height: 38px; }
.wm-top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.wm-account { position: relative; }
.wm-account-btn { display: inline-flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: #121216; }
.wm-account-btn:hover { border-color: var(--line-2); }
.wm-account-btn span.email { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: #fff; padding-right: 8px; }
.wm-account-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 240px; padding: 8px;
  border: 1px solid var(--line-2); border-radius: 16px; background: #141418; box-shadow: 0 20px 50px #000a;
}
.wm-account-menu a, .wm-account-menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text); text-decoration: none; text-align: left; font-size: 13px;
}
.wm-account-menu a:hover, .wm-account-menu button:hover { background: #ffffff0d; color: #fff; }
.wm-account-menu .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; font-size: 12px; color: var(--dim); }
.wm-account-menu .who strong { display: block; color: #fff; font-size: 13px; font-weight: 600; word-break: break-all; }

.avatar {
  display: inline-grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: #06060a; background: var(--av, rgb(var(--product-rgb)));
}
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }

.wm-body { display: grid; grid-template-columns: 236px 400px minmax(0, 1fr); min-height: 0; }

/* sidebar */
.wm-side { display: flex; flex-direction: column; gap: 18px; padding: 18px 12px; border-right: 1px solid var(--line); overflow-y: auto; }
.wm-side .compose-btn { width: 100%; min-height: 46px; }
.folders { display: grid; gap: 2px; }
.folder {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 12px;
  background: transparent; color: var(--text); text-align: left; font-size: 13px; font-weight: 500;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.folder:hover { background: #ffffff08; color: #fff; }
.folder.active { background: rgb(var(--product-rgb) / .13); color: #fff; box-shadow: inset 0 0 0 1px rgb(var(--product-rgb) / .25); }
.folder .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder .count { font-size: 11px; font-weight: 700; color: #06060a; background: var(--lime); border-radius: 999px; padding: 1px 8px; }
.folder.sub { padding-left: 24px; }
.side-label { font-size: 11px; letter-spacing: .13em; font-weight: 600; color: #6f6f7c; padding: 0 12px; text-transform: uppercase; }
.side-foot { margin-top: auto; padding: 12px; font-size: 11px; color: #6f6f7c; }
.side-foot a { color: var(--dim); }

/* message list */
.wm-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--panel); }
.list-head { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.list-head h2 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -.03em; color: #fff; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-head .meta { font-size: 12px; color: var(--dim); }
.bulk { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: rgb(var(--product-rgb) / .08); font-size: 12px; color: #fff; }
.bulk .grow { flex: 1; }
.list-scroll { flex: 1; overflow-y: auto; }
.row {
  position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; width: 100%;
  padding: 14px 16px 14px 12px; border: 0; border-bottom: 1px solid #ffffff0b; background: transparent; text-align: left; color: var(--text);
  transition: background .15s var(--ease);
}
.row:hover { background: #ffffff06; }
.row.selected { background: rgb(var(--product-rgb) / .1); }
.row.selected::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: rgb(var(--product-rgb)); }
.row .check { width: 16px; height: 16px; margin-top: 3px; accent-color: rgb(var(--product-rgb)); opacity: .35; transition: opacity .15s; }
.row:hover .check, .row .check:checked, .wm-list.selecting .row .check { opacity: 1; }
.row .top { display: flex; align-items: baseline; gap: 10px; }
.row .from { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; color: #d8d8df; }
.row .date { font-size: 11.5px; color: var(--dim); white-space: nowrap; }
.row .subject { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--dim); }
.row .badges { display: inline-flex; gap: 6px; margin-left: 6px; vertical-align: -3px; color: var(--dim); }
.row .badges .icon { width: 14px; height: 14px; }
.row.unread .from { color: #fff; font-weight: 700; }
.row.unread .subject { color: #e6e6ec; font-weight: 600; }
.row.unread::after { content: ''; position: absolute; right: 14px; bottom: 18px; width: 7px; height: 7px; border-radius: 99px; background: var(--lime); box-shadow: 0 0 10px #c6ff3d80; }
.row .flag { color: var(--lime); }
.list-empty { padding: 60px 24px; text-align: center; color: var(--dim); font-size: 13px; }
.list-more { display: flex; justify-content: center; padding: 18px; }

/* reading pane */
.wm-read { min-width: 0; overflow-y: auto; padding: 18px; }
.reader { padding: 28px 30px 30px; min-height: 100%; }
.reader-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 22px; }
.reader-actions .grow { flex: 1; }
.reader-actions select { height: 34px; border-radius: 999px; padding: 0 12px; border: 1px solid var(--line-2); background: #0d0d10; font-size: 12px; }
.reader h1 { margin: 0 0 20px; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.2; font-weight: 500; letter-spacing: -.03em; color: #fff; overflow-wrap: anywhere; }
.sender { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.sender .who { flex: 1; min-width: 0; }
.sender .name { color: #fff; font-weight: 600; font-size: 14px; }
.sender .addr { color: var(--dim); font-size: 12.5px; }
.sender .recips { margin-top: 4px; font-size: 12px; color: var(--dim); overflow-wrap: anywhere; }
.sender .when { font-size: 12px; color: var(--dim); white-space: nowrap; }
.notice {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; padding: 12px 16px;
  border-radius: 14px; border: 1px solid var(--line-2); background: #ffffff06; font-size: 12.5px;
}
.notice .grow { flex: 1; min-width: 200px; }
.paper { border-radius: var(--radius-md); overflow: hidden; background: #fff; }
.paper iframe { display: block; width: 100%; min-height: 120px; border: 0; background: #fff; }
.attachments { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%; padding: 10px 14px; border-radius: 14px;
  border: 1px solid var(--line-2); background: #0d0d10; color: #fff; text-decoration: none; font-size: 12.5px;
}
.chip:hover { border-color: rgb(var(--product-rgb) / .7); }
.chip .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.chip .fsize { color: var(--dim); }
.chip button { border: 0; background: transparent; color: var(--dim); padding: 0; display: inline-flex; }
.chip button:hover { color: #fff; }
.empty-read { height: 100%; display: grid; place-items: center; text-align: center; padding: 40px; }
.empty-read img { width: min(320px, 70%); opacity: .35; mix-blend-mode: screen; filter: saturate(.9) brightness(1.3); mask-image: radial-gradient(ellipse, #000 45%, transparent 72%); -webkit-mask-image: radial-gradient(ellipse, #000 45%, transparent 72%); }
.empty-read h3 { margin: 10px 0 6px; color: #fff; font-weight: 500; font-size: 22px; letter-spacing: -.03em; }
.empty-read p { margin: 0; color: var(--dim); font-size: 13px; }
.back-btn { display: none; }

/* compose */
.compose {
  position: fixed; right: 24px; bottom: 24px; z-index: 40; width: min(660px, calc(100vw - 48px)); height: min(640px, calc(100dvh - 110px));
  display: flex; flex-direction: column; overflow: hidden;
}
.compose-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px 22px; border-bottom: 1px solid var(--line); }
.compose-head h3 { flex: 1; margin: 0; font-size: 17px; font-weight: 500; letter-spacing: -.02em; color: #fff; }
.compose-field { display: flex; align-items: center; gap: 12px; padding: 0 22px; border-bottom: 1px solid var(--line); }
.compose-field label { width: 56px; font-size: 12px; color: var(--dim); font-weight: 600; }
.compose-field input { flex: 1; min-width: 0; height: 46px; border: 0; background: transparent; color: #fff; }
.compose-field input:focus { outline: none; }
.compose-field .link-btn { border: 0; background: transparent; color: var(--dim); font-size: 12px; }
.compose-field .link-btn:hover { color: #fff; }
.compose textarea { flex: 1; min-height: 0; width: 100%; padding: 18px 22px; border: 0; resize: none; background: transparent; color: #eaeaf0; line-height: 1.65; }
.compose textarea:focus { outline: none; }
.compose .attachments { margin: 0; padding: 0 22px 12px; }
.compose-foot { display: flex; align-items: center; gap: 10px; padding: 14px 16px 16px 22px; border-top: 1px solid var(--line); }
.compose-foot .grow { flex: 1; }
.compose-foot .hint { font-size: 11.5px; color: #6f6f7c; }
.drop-hint { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(var(--product-rgb) / .12); border: 2px dashed rgb(var(--product-rgb) / .7); border-radius: var(--radius); color: #fff; font-weight: 600; pointer-events: none; }

/* toast + scrim */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-radius: 999px;
  border: 1px solid var(--line-2); background: #17171bf2; color: #fff; font-size: 13px; box-shadow: 0 20px 50px #000a;
}
.toast button { border: 0; background: transparent; color: var(--lime); font-weight: 700; }
.toast.error { border-color: #ff6b6b80; }
.scrim { position: fixed; inset: 0; z-index: 25; background: #0009; }
.spinner { width: 18px; height: 18px; border-radius: 99px; border: 2px solid #ffffff30; border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 50px; }

/* -------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .wm-body { grid-template-columns: 216px 340px minmax(0, 1fr); }
  .wm-top .wm-brand { min-width: 0; }
}
@media (max-width: 960px) {
  .wm-body { grid-template-columns: 320px minmax(0, 1fr); }
  .wm-menu-btn { display: inline-flex; }
  .wm-side {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 30; width: 272px; background: #0c0c10;
    transform: translateX(-100%); transition: transform .28s var(--ease); border-right: 1px solid var(--line-2);
  }
  .wm-app.side-open .wm-side { transform: none; }
  .wm-brand small { display: none; }
}
@media (max-width: 720px) {
  .wm-login { padding: 0 16px; --sn-nav-height: 60px; }
  .wm-login-grid { grid-template-columns: 1fr; gap: 36px; padding: 16px 0 48px; }
  .wm-login-card { padding: 26px 22px; }
  .wm-login-lede { font-size: 16px; }
  .wm-top { gap: 8px; padding: 0 10px; }
  .wm-top .wm-brand span { display: none; }
  .wm-account-btn span.email { display: none; }
  .wm-body { grid-template-columns: minmax(0, 1fr); }
  .wm-read { display: none; padding: 10px; }
  .wm-app.reading .wm-list { display: none; }
  .wm-app.reading .wm-read { display: block; }
  .back-btn { display: inline-flex; }
  .reader { padding: 20px 18px; }
  .compose { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
