/* ===================================================================
   NordicyMail — Gmail-style light theme
   =================================================================== */
:root {
  /* surfaces */
  --bg:        #f6f8fc;   /* app chrome background (Gmail grey-blue) */
  --paper:     #ffffff;   /* content cards */
  --side:      #eaf1fb;   /* selected / soft blue chip */
  --hover:     #f1f3f4;   /* neutral hover */
  --hover-2:   #e8eaed;
  /* hairlines */
  --line:      #e0e3e7;
  --line-2:    #dadce0;
  --line-3:    #c4c7cc;
  /* ink */
  --ink:       #1f1f1f;
  --ink-2:     #444746;
  --ink-3:     #5f6368;
  --ink-4:     #80868b;
  /* Google blue */
  --blue:      #0b57d0;
  --blue-dark: #0842a0;
  --blue-soft: #d3e3fd;
  --blue-tint: #ecf3fe;
  --danger:    #d93025;
  --ok:        #188038;
  /* shape + motion */
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 24px; --pill: 999px;
  --ease: cubic-bezier(.2,0,0,1);
  --shadow-1: 0 1px 2px rgba(60,64,67,.30), 0 1px 3px 1px rgba(60,64,67,.15);
  --shadow-2: 0 1px 3px rgba(60,64,67,.30), 0 4px 8px 3px rgba(60,64,67,.15);
  --container: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Google Sans", Roboto, -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
.hidden { display: none !important; }
.mono { font-variant-numeric: tabular-nums; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 2rem); }
::selection { background: var(--blue-soft); }

/* decorative layers from the dark theme — not used in the Gmail look */
.cursor-glow, .grid-bg { display: none; }

/* ---------- wordmark ---------- */
.wordmark {
  font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; color: var(--ink);
  text-decoration: none; display: inline-flex; align-items: center;
}
.wordmark span { color: var(--blue); font-weight: 700; }

/* ---------- buttons (Material-style) ---------- */
.btn {
  --pad-y: .58rem; --pad-x: 1.35rem;
  font: inherit; font-weight: 500; font-size: .92rem; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--pill); padding: var(--pad-y) var(--pad-x);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  color: var(--blue); background: transparent; position: relative; white-space: nowrap;
  transition: background .15s var(--ease), box-shadow .15s var(--ease), border-color .15s;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }
.btn svg { width: 17px; height: 17px; }

.btn-solid { background: var(--blue); color: #fff; }
.btn-solid:hover { background: var(--blue-dark); box-shadow: var(--shadow-1); }
.btn-solid:active { box-shadow: none; }

.btn-line { border-color: var(--line-2); color: var(--blue); background: var(--paper); }
.btn-line:hover { background: var(--blue-tint); border-color: var(--line-3); }

.btn-quiet { color: var(--blue); padding-left: .9rem; padding-right: .9rem; }
.btn-quiet:hover { background: var(--blue-tint); }

.btn-lg { --pad-y: .78rem; --pad-x: 1.7rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn .btn-label { display: inline-flex; align-items: center; gap: .5rem; }
.btn.loading { pointer-events: none; opacity: .85; }
.btn.loading .btn-label { opacity: 0; }
.btn.loading .spinner { opacity: 1; }
.spinner {
  position: absolute; width: 16px; height: 16px; border-radius: 50%; opacity: 0;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.btn-line .spinner, .btn-quiet .spinner { border-color: var(--blue-soft); border-top-color: var(--blue); }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: transparent; border: none; color: var(--ink-3); cursor: pointer;
  transition: background .15s var(--ease), color .15s;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn:active { background: var(--hover-2); }
.icon-btn.danger:hover { color: var(--danger); background: #fce8e6; }
.icon-btn.ghosty { color: var(--ink-3); }
.icon-btn.spinning svg { animation: spin .6s var(--ease); }

/* ===================== LANDING ===================== */
.landing { position: relative; z-index: 1; background: var(--paper); min-height: 100%; }
.site-header {
  position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.site-header-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.site-nav { display: flex; align-items: center; gap: .3rem; }
.nav-link {
  color: var(--ink-2); text-decoration: none; font-size: .92rem; font-weight: 500;
  padding: .5rem .85rem; border-radius: var(--pill); transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--hover); color: var(--ink); }
.site-nav .btn { margin-left: .4rem; }

/* hero */
.hero { text-align: center; padding: clamp(3.5rem, 10vw, 7rem) 0 0; }
.eyebrow {
  text-transform: none; letter-spacing: 0; font-size: .9rem; font-weight: 500;
  color: var(--blue); margin: 0 0 1.1rem;
}
.display {
  font-size: clamp(2.5rem, 6.5vw, 4.2rem); font-weight: 700; letter-spacing: -.02em;
  line-height: 1.08; margin: 0 auto 1.2rem; max-width: 16ch; color: var(--ink);
}
.lede { font-size: clamp(1.02rem, 2.2vw, 1.2rem); color: var(--ink-3); max-width: 600px; margin: 0 auto 2rem; line-height: 1.6; }
.lede .mono {
  color: var(--blue); font-weight: 500; padding: .05em .4em;
  background: var(--blue-tint); border-radius: 6px;
}
.hero-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

/* showcase */
.showcase { margin-top: clamp(3rem, 7vw, 5rem); padding: 0 .5rem; }
.showcase-frame {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  max-width: 940px; margin: 0 auto; box-shadow: var(--shadow-2);
  animation: rise .8s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .showcase-frame { animation: none; } }
.sc-chrome { display: flex; align-items: center; gap: .45rem; padding: .75rem 1.1rem; background: var(--bg); border-bottom: 1px solid var(--line); }
.sc-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.sc-addr { margin-left: auto; color: var(--ink-4); font-size: .78rem; }
.sc-body { display: grid; grid-template-columns: 190px 1fr; text-align: left; background: var(--paper); }
.sc-side { padding: 1rem .8rem; background: var(--bg); display: flex; flex-direction: column; gap: .15rem; }
.sc-compose {
  background: #c2e7ff; color: #001d35; text-align: center; padding: .6rem 1rem;
  border-radius: var(--r-lg); font-weight: 500; font-size: .88rem; margin-bottom: .7rem;
  box-shadow: var(--shadow-1); width: fit-content;
}
.sc-folder {
  display: flex; align-items: center; justify-content: space-between; padding: .45rem .9rem;
  border-radius: var(--pill); color: var(--ink-2); font-size: .88rem;
}
.sc-folder.is-active { background: var(--blue-soft); color: var(--ink); font-weight: 700; }
.sc-folder em { font-style: normal; font-size: .76rem; font-weight: 700; color: var(--ink-2); }
.sc-list { padding: .4rem .5rem; }
.sc-mail { display: flex; align-items: center; gap: .8rem; padding: .7rem .8rem; border-bottom: 1px solid var(--line); }
.sc-mail:last-child { border-bottom: none; }
.sc-mail.unread b { color: var(--ink); font-weight: 700; }
.sc-mail.unread::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex: none; order: 3; }
.sc-av {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--blue-soft); color: var(--blue-dark); font-size: .74rem; font-weight: 700;
}
.sc-mail-main { min-width: 0; flex: 1; }
.sc-mail-main b { display: block; font-size: .88rem; font-weight: 500; color: var(--ink-2); }
.sc-mail-main p { margin: .1rem 0 0; font-size: .82rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-mail time { color: var(--ink-4); font-size: .74rem; flex: none; }

/* stats strip */
.stats {
  display: flex; align-items: center; justify-content: center; gap: clamp(1rem,4vw,3rem);
  margin: clamp(3rem,7vw,5rem) auto; padding: 1.4rem; flex-wrap: wrap;
}
.stat { text-align: center; }
.stat b { display: block; font-size: 1.3rem; font-weight: 700; color: var(--ink); }
.stat span { color: var(--ink-3); font-size: .88rem; }
.stat-div { width: 1px; height: 36px; background: var(--line-2); }

/* features */
.features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin: 1rem 0;
}
.feature {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(1.5rem, 3vw, 2.2rem); transition: box-shadow .2s var(--ease);
}
.feature:hover { box-shadow: var(--shadow-1); }
.feature-ic {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--blue-tint); color: var(--blue); margin-bottom: 1.1rem;
}
.feature-ic svg { width: 22px; height: 22px; }
.feature h3 { margin: 0 0 .5rem; font-size: 1.12rem; font-weight: 500; color: var(--ink); }
.feature p { margin: 0; color: var(--ink-3); font-size: .95rem; line-height: 1.6; }

/* pricing */
.pricing { display: flex; justify-content: center; margin: clamp(3.5rem,8vw,6rem) 0 clamp(3rem,6vw,5rem); }
.price-card {
  width: 100%; max-width: 460px; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: clamp(1.8rem,4vw,2.6rem);
  box-shadow: var(--shadow-1); transition: box-shadow .2s var(--ease);
}
.price-card:hover { box-shadow: var(--shadow-2); }
.price-card .eyebrow { margin-bottom: 1rem; }
.price { display: flex; align-items: baseline; gap: .5rem; }
.amount { font-size: clamp(2.6rem,6vw,3.2rem); font-weight: 700; color: var(--ink); }
.per { color: var(--ink-3); font-size: .95rem; }
.price-sub { color: var(--ink-3); margin: .6rem 0 1.4rem; line-height: 1.6; }
.price-list { list-style: none; margin: 0 0 1.7rem; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.price-list li { position: relative; padding-left: 1.8rem; color: var(--ink-2); font-size: .94rem; }
.price-list li::before {
  content: ""; position: absolute; left: 0; top: .32em; width: 14px; height: 8px;
  border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg);
}
.price-list .mono { color: var(--blue); }

/* footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 2rem; background: var(--paper); }
.footer-in { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 1rem; flex-wrap: wrap; }
.footer-copy { color: var(--ink-4); font-size: .85rem; }
.socials { display: flex; gap: .4rem; }
.social {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  color: var(--ink-3); text-decoration: none; transition: background .15s, color .15s;
}
.social:hover { background: var(--hover); color: var(--ink); }
.social .logo-svg { width: 19px; height: 19px; fill: currentColor; stroke: none; }

/* reveal on load (subtle fade) */
.reveal { opacity: 0; transform: translateY(10px); animation: reveal .6s var(--ease) forwards; }
.reveal:nth-child(2){animation-delay:.06s}.reveal:nth-child(3){animation-delay:.12s}
.reveal:nth-child(4){animation-delay:.18s}.reveal:nth-child(5){animation-delay:.24s}
@keyframes reveal { to { opacity: 1; transform: none; } }

/* scroll reveal */
.sr { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.sr.in { opacity: 1; transform: none; }
.sr-d1.in { transition-delay: .07s; } .sr-d2.in { transition-delay: .14s; } .sr-d3.in { transition-delay: .21s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  .sr { opacity: 1; transform: none; transition: none; }
}

/* ===================== AUTH / PAY ===================== */
.screen { position: relative; z-index: 1; min-height: 100%; display: grid; place-items: center; padding: 1.5rem; background: var(--bg); }
.screen-back {
  position: fixed; top: 1.2rem; left: 1.2rem; display: inline-flex; align-items: center; gap: .4rem;
  background: transparent; border: none; color: var(--ink-2); padding: .55rem .95rem; border-radius: var(--pill);
  font: inherit; font-size: .9rem; font-weight: 500; cursor: pointer; transition: background .15s;
}
.screen-back:hover { background: var(--hover); color: var(--ink); }
.screen-back svg { width: 16px; height: 16px; }
.card {
  width: 100%; max-width: 420px; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: clamp(1.8rem, 5vw, 2.6rem);
  box-shadow: var(--shadow-1); animation: pop .3s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card-mark { display: flex; justify-content: center; margin-bottom: 1.6rem; font-size: 1.2rem; }
.form-title { margin: 0 0 .35rem; font-size: 1.5rem; font-weight: 500; color: var(--ink); }
.form-title.center, .form-sub.center, .form-foot.center { text-align: center; }
.form-sub { margin: 0 0 1.6rem; color: var(--ink-3); font-size: .96rem; }
.field { display: block; margin-bottom: 1.05rem; }
.field-label { display: block; font-size: .82rem; color: var(--ink-3); margin-bottom: .4rem; font-weight: 500; }
.field input {
  width: 100%; padding: .8rem .95rem; border-radius: var(--r-sm); background: var(--paper);
  border: 1px solid var(--line-2); color: var(--ink); font: inherit; font-size: .96rem;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: var(--ink-4); }
.field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.addr {
  display: flex; align-items: stretch; background: var(--paper); border: 1px solid var(--line-2);
  border-radius: var(--r-sm); overflow: hidden; transition: border-color .15s, box-shadow .15s;
}
.addr:focus-within { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.addr input { border: none; background: transparent; flex: 1; min-width: 0; padding: .8rem .95rem; font: inherit; font-size: .96rem; color: var(--ink); }
.addr input:focus { outline: none; }
.addr-suffix {
  display: grid; place-items: center; padding: 0 .9rem; color: var(--ink-3); font-size: .9rem;
  background: var(--bg); border-left: 1px solid var(--line); white-space: nowrap;
}
.btn-block.btn-lg { margin-top: .4rem; border-radius: var(--pill); }
.form-foot { margin: 1.2rem 0 0; color: var(--ink-3); font-size: .9rem; }
.form-foot a { color: var(--blue); text-decoration: none; font-weight: 500; }
.form-foot a:hover { text-decoration: underline; }
.form-error { color: var(--danger); font-size: .87rem; min-height: 1.1rem; margin: .8rem 0 0; text-align: center; }

/* pay */
.pay-badge {
  width: 56px; height: 56px; margin: 0 auto 1.2rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--blue-tint); color: var(--blue);
}
.pay-badge svg { width: 26px; height: 26px; }
.pay-email { color: var(--ink); word-break: break-all; }
.pay-status { display: flex; align-items: center; justify-content: center; gap: .55rem; margin-top: 1.2rem; color: var(--ink-3); font-size: .9rem; }
.pay-spin { position: static; opacity: 1; width: 15px; height: 15px; border: 2px solid var(--blue-soft); border-top-color: var(--blue); }
.pay-status.done { color: var(--ok); }
.pay-status.done .pay-spin { display: none; }

/* ===================== APP ===================== */
.app { position: relative; z-index: 1; height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.appbar { display: flex; align-items: center; gap: .7rem; height: 64px; padding: 0 clamp(.7rem, 2.5vw, 1.2rem); flex: none; }
.nav-toggle { display: none; }
.appbar-mark { font-size: 1.1rem; }
.appbar-search {
  flex: 1; max-width: 620px; margin: 0 auto 0 1rem; display: flex; align-items: center; gap: .7rem;
  background: #e9eef6; border: 1px solid transparent; border-radius: var(--pill); padding: .62rem 1.1rem;
  color: var(--ink-3); transition: background .15s var(--ease), box-shadow .15s;
}
.appbar-search:focus-within { background: var(--paper); box-shadow: var(--shadow-1); }
.appbar-search svg { width: 18px; height: 18px; }
.appbar-search input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--ink); font: inherit; font-size: .95rem; }
.appbar-search input::placeholder { color: var(--ink-3); }
.appbar-user { position: relative; }
.user-chip {
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  color: #fff; font-weight: 500; font-size: .9rem; background: var(--blue);
  transition: box-shadow .15s;
}
.user-chip:hover { box-shadow: 0 0 0 4px var(--blue-tint); }
.usermenu {
  position: absolute; right: 0; top: 48px; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r); padding: .45rem; min-width: 240px; box-shadow: var(--shadow-2);
  animation: pop .15s var(--ease); z-index: 50;
}
.usermenu-email { padding: .6rem .7rem; color: var(--ink-3); font-size: .85rem; border-bottom: 1px solid var(--line); margin-bottom: .35rem; word-break: break-all; }
.usermenu-item {
  width: 100%; display: flex; align-items: center; gap: .7rem; text-align: left; background: transparent;
  border: none; color: var(--ink); padding: .65rem .7rem; border-radius: var(--r-sm); cursor: pointer;
  font: inherit; font-size: .92rem; transition: background .12s;
}
.usermenu-item svg { width: 18px; height: 18px; color: var(--ink-3); }
.usermenu-item:hover { background: var(--hover); }

.workspace { flex: 1; display: flex; min-height: 0; position: relative; }
.scrim { display: none; }
.rail { width: 240px; flex: none; padding: .6rem .8rem 1rem; display: flex; flex-direction: column; gap: .1rem; }
.rail-compose {
  display: flex; align-items: center; gap: .7rem; width: fit-content;
  background: #c2e7ff; color: #001d35; border: none; border-radius: var(--r-lg);
  padding: .85rem 1.4rem .85rem 1.1rem; font: inherit; font-size: .92rem; font-weight: 500;
  cursor: pointer; margin: .4rem 0 1rem; box-shadow: var(--shadow-1);
  transition: box-shadow .15s var(--ease), background .15s;
}
.rail-compose:hover { box-shadow: var(--shadow-2); background: #b3dfff; }
.rail-compose svg { width: 18px; height: 18px; }
.rail-item {
  display: flex; align-items: center; gap: .85rem; text-align: left; background: transparent; border: none;
  color: var(--ink-2); padding: .55rem .5rem .55rem 1rem; border-radius: var(--pill);
  font: inherit; font-size: .9rem; font-weight: 400; cursor: pointer;
  transition: background .12s var(--ease);
}
.rail-item svg { width: 18px; height: 18px; color: var(--ink-3); }
.rail-item:hover { background: var(--hover); }
.rail-item.is-active { background: var(--blue-soft); color: var(--ink); font-weight: 700; }
.rail-item.is-active svg { color: var(--ink); }
.rail-badge {
  margin-left: auto; font-style: normal; font-size: .76rem; font-weight: 700; color: var(--ink-2);
  font-variant-numeric: tabular-nums; padding-right: .5rem;
}
.rail-item.is-active .rail-badge { color: var(--ink); }
.rail-hints {
  margin-top: auto; padding: 1rem .6rem 0; display: flex; flex-direction: column; gap: .45rem;
  border-top: 1px solid var(--line); color: var(--ink-4); font-size: .78rem;
}
.rail-hints kbd {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px;
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; background: var(--paper);
  font: 500 .7rem/1 inherit; color: var(--ink-2); margin-right: .35rem;
}

/* mail pane — white rounded card like Gmail */
.pane {
  flex: 1; min-width: 0; overflow-y: auto; background: var(--paper);
  border-radius: var(--r-lg); margin: 0 .8rem .8rem 0; border: 1px solid var(--line);
}
.pane-bar {
  display: flex; align-items: center; gap: .4rem; padding: .9rem clamp(.9rem,3vw,1.4rem) .6rem;
  position: sticky; top: 0; background: var(--paper); z-index: 5; border-bottom: 1px solid var(--line);
}
.pane-title { margin: 0; font-size: 1.15rem; font-weight: 500; color: var(--ink); }
.pane-bar .icon-btn { margin-left: auto; }
.read-actions { gap: .2rem; }
.read-actions .icon-btn:first-child { margin-right: auto; }
.read-actions .icon-btn { margin-left: 0; }

.maillist { list-style: none; margin: 0; padding: 0 0 2.5rem; }
.maillist li {
  display: flex; align-items: center; gap: .85rem; padding: .7rem clamp(.9rem,2vw,1.2rem);
  cursor: pointer; border-bottom: 1px solid var(--line);
  transition: box-shadow .12s var(--ease), background .12s;
  animation: fadein .25s var(--ease) backwards;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.maillist li:hover { box-shadow: inset 1px 0 0 var(--line-2), inset -1px 0 0 var(--line-2), var(--shadow-1); position: relative; z-index: 1; }
.maillist li:not(.unread) { background: #f6f8fc; }
.maillist li.unread { background: var(--paper); }
.maillist li.unread .m-from { color: var(--ink); font-weight: 700; }
.maillist li.unread .m-subj { color: var(--ink); font-weight: 700; }
.maillist li.unread::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); flex: none; }
.maillist li:not(.unread)::before { content: ""; width: 6px; flex: none; }
.maillist li.is-selected { background: var(--side); }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--blue-soft); color: var(--blue-dark); font-weight: 700; font-size: .8rem;
}
.m-main { flex: 1; min-width: 0; }
.m-top { display: flex; align-items: baseline; gap: .6rem; }
.m-from { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.m-date { margin-left: auto; color: var(--ink-3); font-size: .78rem; flex: none; font-variant-numeric: tabular-nums; }
.m-subj { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: .1rem; font-size: .88rem; }

/* skeleton + empty */
.skeleton { padding: .4rem clamp(.9rem,2vw,1.2rem); }
.sk {
  height: 56px; border-radius: var(--r-sm); margin-bottom: .35rem;
  background: linear-gradient(90deg, var(--hover) 25%, var(--hover-2) 37%, var(--hover) 63%);
  background-size: 400% 100%; animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.empty { display: flex; flex-direction: column; align-items: center; gap: .9rem; color: var(--ink-4); padding: 5rem 1rem; }
.empty svg { width: 44px; height: 44px; color: var(--line-3); }

/* read view */
#readView { animation: pop .2s var(--ease); }
.read-wrap { max-width: 780px; margin: 0 auto; padding: 0 clamp(1rem,3vw,1.6rem) 4rem; }
.read-subject { margin: .8rem 0 1.2rem; font-size: clamp(1.3rem,3.5vw,1.6rem); font-weight: 500; line-height: 1.25; color: var(--ink); }
.read-head { display: flex; align-items: center; gap: .9rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); margin-bottom: 1.4rem; }
.read-av {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--blue-soft); color: var(--blue-dark); font-weight: 700; font-size: .9rem;
}
.read-head-meta { min-width: 0; }
.read-from { font-weight: 500; color: var(--ink); }
.read-to { color: var(--ink-3); font-size: .85rem; margin-top: .12rem; }
.read-date { margin-left: auto; color: var(--ink-3); font-size: .85rem; flex: none; }
.read-body { line-height: 1.7; white-space: pre-wrap; word-wrap: break-word; color: var(--ink-2); font-size: .96rem; }
.read-body iframe { width: 100%; border: 1px solid var(--line); min-height: 60vh; background: #fff; border-radius: var(--r-sm); }

/* attachments (read view) */
.read-attach { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.3rem; }
.read-attach a {
  display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .85rem; border-radius: var(--r-sm);
  background: var(--paper); border: 1px solid var(--line-2); color: var(--ink-2); text-decoration: none;
  font-size: .86rem; transition: background .15s, box-shadow .15s; max-width: 100%;
}
.read-attach a:hover { background: var(--blue-tint); box-shadow: var(--shadow-1); color: var(--ink); }
.read-attach a svg { width: 15px; height: 15px; flex: none; color: var(--blue); }
.read-attach .att-size { color: var(--ink-4); font-size: .78rem; }
.read-attach .att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* composer — Gmail-style card, dark header */
.composer {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: flex-end;
  padding: clamp(0px, 2.5vw, 1.5rem); background: transparent; pointer-events: none;
}
.composer-card {
  width: 540px; max-width: 100%; max-height: 92vh; background: var(--paper);
  border-radius: var(--r-sm) var(--r-sm) 0 0; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12), 0 5px 5px -3px rgba(0,0,0,.2);
  animation: slideup .22s var(--ease); pointer-events: auto;
}
@keyframes slideup { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.composer-head {
  display: flex; align-items: center; justify-content: space-between; padding: .55rem .7rem .55rem 1.1rem;
  background: #404346; color: #e8eaed; font-weight: 500; font-size: .88rem;
}
.composer-head .icon-btn { width: 32px; height: 32px; color: #bdc1c6; }
.composer-head .icon-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.composer-fields { display: flex; flex-direction: column; }
.composer-row { display: flex; align-items: center; gap: .7rem; padding: 0 1.1rem; border-bottom: 1px solid var(--line); }
.composer-row span { color: var(--ink-3); font-size: .85rem; width: 44px; flex: none; }
.composer-row input { flex: 1; background: transparent; border: none; outline: none; color: var(--ink); font: inherit; font-size: .92rem; padding: .8rem 0; }
.composer-row input::placeholder { color: var(--ink-4); }
.composer-fields textarea {
  background: transparent; border: none; outline: none; color: var(--ink); font: inherit; font-size: .95rem;
  padding: 1rem 1.1rem; min-height: 240px; resize: vertical; line-height: 1.6;
}
.composer-fields textarea::placeholder { color: var(--ink-4); }
.composer-foot { padding: .8rem 1.1rem; display: flex; align-items: center; gap: .6rem; border-top: 1px solid var(--line); }
.composer-foot .btn-solid { border-radius: var(--pill); }

/* composer extras */
.addr-row { position: relative; }
.cc-toggle {
  background: transparent; border: none; color: var(--ink-3); font: inherit; font-size: .84rem; cursor: pointer;
  padding: .3rem .5rem; border-radius: 6px; flex: none;
}
.cc-toggle:hover { color: var(--blue); background: var(--blue-tint); }
.draft-state { color: var(--ink-4); font-size: .8rem; margin-left: auto; }

/* attachments (composer) */
.attach-chips { display: flex; flex-wrap: wrap; gap: .45rem; padding: .7rem 1.1rem; border-top: 1px solid var(--line); }
.attach-chip {
  display: inline-flex; align-items: center; gap: .5rem; padding: .38rem .65rem; border-radius: var(--pill);
  background: var(--blue-tint); border: 1px solid var(--blue-soft); font-size: .82rem; color: var(--ink-2); max-width: 240px;
}
.attach-chip .att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip .att-size { color: var(--ink-4); font-size: .74rem; flex: none; }
.attach-chip button {
  display: grid; place-items: center; width: 17px; height: 17px; border: none; border-radius: 50%;
  background: rgba(0,0,0,.08); color: var(--ink-3); cursor: pointer; font-size: .72rem; line-height: 1; padding: 0; flex: none;
}
.attach-chip button:hover { background: #fce8e6; color: var(--danger); }

/* contacts autocomplete */
.suggest {
  position: absolute; left: 56px; right: 12px; top: calc(100% - 2px); z-index: 20;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--shadow-2); overflow: hidden; max-height: 210px; overflow-y: auto;
}
.suggest-item {
  display: flex; align-items: baseline; gap: .6rem; width: 100%; text-align: left; background: transparent;
  border: none; color: var(--ink-2); padding: .6rem .85rem; cursor: pointer; font: inherit; font-size: .88rem;
}
.suggest-item b { color: var(--ink); font-weight: 500; }
.suggest-item:hover, .suggest-item.is-hot { background: var(--hover); }

/* settings — reuse composer shell but centered */
#settingsModal { align-items: center; justify-content: center; background: rgba(32,33,36,.5); pointer-events: auto; }
.settings-card { width: 540px; border-radius: var(--r-lg); max-height: 88vh; }
.settings-card .composer-head { background: var(--paper); color: var(--ink); border-bottom: 1px solid var(--line); font-size: 1rem; }
.settings-card .composer-head .icon-btn { color: var(--ink-3); }
.settings-card .composer-head .icon-btn:hover { background: var(--hover); color: var(--ink); }
.settings-body { overflow-y: auto; padding: 1.2rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 1.6rem; }
.settings-group h3 { margin: 0 0 1rem; font-size: .95rem; font-weight: 500; color: var(--ink); }
.settings-group .field-label small { color: var(--ink-4); font-weight: 400; }
.settings-group textarea {
  width: 100%; padding: .8rem .95rem; border-radius: var(--r-sm); background: var(--paper);
  border: 1px solid var(--line-2); color: var(--ink); font: inherit; font-size: .93rem; resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
.settings-group textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.settings-group .btn { margin-top: .2rem; }
.settings-group .form-error { text-align: left; display: inline-block; margin-left: .8rem; }

/* toasts — Gmail-style dark snackbar, bottom-left */
.toasts {
  position: fixed; bottom: 1.2rem; left: 1.2rem; z-index: 100;
  display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; max-width: 92vw;
}
.toast {
  padding: .8rem 1.3rem; border-radius: var(--r-sm); background: #323639; color: #e8eaed;
  box-shadow: var(--shadow-2); font-size: .9rem; animation: toastin .22s var(--ease);
}
.toast.ok { color: #e8eaed; }
.toast.err { color: #f6aea9; }
.toast.out { animation: toastout .22s ease forwards; }
@keyframes toastin { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastout { to { transform: translateY(10px); opacity: 0; } }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .features { grid-template-columns: 1fr; }
  .sc-side { display: none; }
  .sc-body { grid-template-columns: 1fr; }
  .nav-link { display: none; }
}
@media (max-width: 680px) {
  .site-nav .btn-quiet { display: none; }
  .nav-toggle { display: inline-grid; }
  .appbar-search { display: none; }
  .appbar-mark { display: none; }
  .hero-actions { flex-direction: column; align-items: stretch; padding: 0 .5rem; }
  .stats { gap: 1.2rem; }
  .stat-div { display: none; }
  .pane { margin: 0 0 0; border-radius: 0; border-left: none; border-right: none; }
  .rail {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 55; width: 270px; background: var(--bg);
    transform: translateX(-100%); transition: transform .22s var(--ease); padding-top: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom)); box-shadow: var(--shadow-2);
  }
  .app.nav-open .rail { transform: none; }
  .scrim {
    display: block; position: fixed; inset: 0; z-index: 50; background: rgba(32,33,36,.5);
    opacity: 0; pointer-events: none; transition: opacity .22s;
  }
  .app.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .composer { padding: 0; align-items: stretch; }
  .composer-card { width: 100%; max-height: 100dvh; border-radius: 0; }
  .toasts { bottom: calc(1rem + env(safe-area-inset-bottom)); left: 1rem; }
}
