/*
 * Pigeon. Layout like Front: rail | sidebar | list | conversation, on soft greys, with white cards for what you
 * read and write. Indigo accent as in Front; internal (team-only) things are amber. Inter, self-hosted.
 * Follows the system light/dark preference. Narrow screens show one column at a time.
 */
@font-face {
  font-family: "Inter";
  src: url("/app/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("/app/inter-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --page: #f4f4f7;
  --rail: #ebebf0;
  --list: #fcfcfd;
  --pane: #f8f8fa;
  --select: #e2e2ea;
  --surface: #ffffff;
  --surface-2: #f8f8fa;
  --surface-3: #efeff3;
  --hover: rgba(24, 24, 48, .05);
  --fg: #18181d;
  --muted: #5d5f6b;
  --faint: #8f919c;
  --line: #e7e7ec;
  --line-strong: #d7d8df;
  --accent: #5e5ce6;
  --accent-strong: #4a48c9;
  --accent-soft: #eeeefd;
  --on-accent: #ffffff;
  --unread: #5e5ce6;
  --mention: #4a48c9;
  --mention-bg: #e6e6fc;
  --internal: #93600c;
  --internal-soft: #fdf6e7;
  --internal-line: #f0e0bb;
  --ok: #16794a;
  --ok-soft: #e2f3e9;
  --star: #e2a400;
  --danger: #b3261e;
  --snack: #1d2027;
  --on-snack: #f2f4f7;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --raised: 0 2px 6px rgba(16, 24, 40, .06), 0 10px 24px rgba(16, 24, 40, .06);
  --pop: 0 8px 16px rgba(16, 24, 40, .08), 0 20px 48px rgba(16, 24, 40, .14);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #121317; --rail: #0d0e11; --list: #15161a; --pane: #111215; --select: #2a2b33;
    --surface: #1b1c21; --surface-2: #17181c; --surface-3: #25262d; --hover: rgba(255, 255, 255, .05);
    --fg: #ececf1; --muted: #a6a8b4; --faint: #7c7e8a; --line: #26272e; --line-strong: #33343d;
    --accent: #8583f7; --accent-strong: #a9a8ff; --accent-soft: #24244a; --on-accent: #ffffff; --unread: #8f8dfa;
    --mention: #b9b8ff; --mention-bg: #2c2b58; --internal: #e5b660; --internal-soft: #272114; --internal-line: #44391c;
    --ok: #6fd39c; --ok-soft: #173426; --star: #f2c443; --danger: #f2b8b5; --snack: #e9ebf0; --on-snack: #171a20;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --raised: 0 2px 8px rgba(0, 0, 0, .35); --pop: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--page); color: var(--fg); font: 14px/1.5 var(--font); letter-spacing: -.006em;
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; overflow: hidden;
}
#root { height: 100%; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent-strong); }
kbd { font: 500 11.5px/1 var(--font); background: var(--surface); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; padding: 3px 6px; color: var(--muted); }
svg.i { width: 18px; height: 18px; flex: none; }
.boot { display: grid; place-items: center; height: 100%; color: var(--muted); }
.fine { color: var(--faint); font-size: 12.5px; }

/* ---------- Buttons ---------- */
.btn {
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px;
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 0 12px; font-weight: 550;
  font-size: 13.5px; white-space: nowrap; color: var(--fg); box-shadow: 0 1px 1px rgba(16, 24, 40, .04); transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); box-shadow: 0 1px 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.big { height: 42px; padding: 0 22px; font-size: 15px; border-radius: 11px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btn.done-btn { color: var(--ok); }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 9px; background: none;
  color: var(--muted); flex: none; text-decoration: none; transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--hover); color: var(--fg); }
.icon-btn.on { color: var(--accent-strong); background: var(--accent-soft); }
.icon-btn.star, .star { color: var(--star); }
.icon-btn.flip svg { transform: scaleX(-1); }
.icon-btn:disabled { opacity: .45; }
.link { border: 0; background: none; color: var(--accent-strong); padding: 0; font-weight: 550; font-size: 13px; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ---------- Avatars: soft rounded squares, pastel tint of the person's colour ---------- */
.av {
  --c: #6b7280; width: 32px; height: 32px; border-radius: 30%; display: inline-grid; place-items: center; flex: none; overflow: hidden;
  font-weight: 650; font-size: 12px; letter-spacing: .01em; color: color-mix(in srgb, var(--c) 80%, #000);
  background: color-mix(in srgb, var(--c) 16%, var(--surface));
}
@media (prefers-color-scheme: dark) { .av { color: color-mix(in srgb, var(--c) 60%, #fff); background: color-mix(in srgb, var(--c) 30%, var(--surface)); } }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.xs { width: 20px; height: 20px; font-size: 9px; border-radius: 6px; }
.av.sm { width: 28px; height: 28px; font-size: 11px; }
.av.lg { width: 40px; height: 40px; font-size: 14px; }

/* ---------- Sign in ---------- */
.signin { display: grid; place-items: center; height: 100%; padding: 16px; background: radial-gradient(1000px 520px at 50% -10%, var(--accent-soft), var(--page)); }
.signin .card { background: var(--surface); border-radius: 20px; box-shadow: var(--pop); padding: 40px 34px; max-width: 420px; width: 100%; text-align: center; display: grid; gap: 12px; justify-items: center; }
.signin h1 { margin: 6px 0 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.signin p { margin: 0; color: var(--muted); }

/* ---------- Layout: rail | sidebar | list | conversation ---------- */
.app { display: grid; grid-template-columns: auto minmax(320px, 390px) minmax(0, 1fr); height: 100%; }
.nav { display: grid; grid-template-columns: 56px 236px; min-height: 0; background: var(--page); }
.rail { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0 12px; background: var(--rail); min-height: 0; }
.rail-logo { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 8px; }
.rail-logo img { width: 28px; height: 28px; }
.rail-btn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 11px; background: none; color: var(--muted); text-decoration: none; transition: background .12s, color .12s; }
.rail-btn svg { width: 20px; height: 20px; }
.rail-btn:hover { background: var(--hover); color: var(--fg); }
.rail-btn[aria-current="page"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.rail-badge { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 700; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--rail); }
.rail .grow { flex: 1; }
.rail-me { position: relative; margin-top: 4px; }
.rail-av { border: 0; background: none; padding: 4px; border-radius: 11px; display: grid; }
.rail-av:hover { background: var(--hover); }
.me-menu { position: absolute; left: calc(100% + 8px); bottom: 0; z-index: 45; width: 250px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--pop); display: grid; gap: 1px; }
.me-menu .who { display: grid; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; line-height: 1.35; }
.me-menu .who b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-menu .who span { color: var(--faint); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-menu a, .me-menu button { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border: 0; background: none; border-radius: 8px; color: var(--fg); text-decoration: none; font-weight: 500; text-align: left; }
.me-menu a:hover, .me-menu button:hover { background: var(--hover); }
.me-menu svg { width: 17px; height: 17px; color: var(--faint); }
.side { background: var(--page); display: flex; flex-direction: column; gap: 1px; padding: 12px 10px; overflow-y: auto; min-height: 0; }
.side-head { display: flex; align-items: center; gap: 4px; padding: 0 2px 10px 10px; }
.side-head h2 { flex: 1; margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.compose-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 9px; background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 2px color-mix(in srgb, var(--accent) 35%, transparent); transition: background .12s; }
.compose-btn:hover { background: var(--accent-strong); }
.compose-btn:disabled { opacity: .45; cursor: default; }
.compose-btn svg { width: 19px; height: 19px; }
.side h3 { font-size: 12px; font-weight: 600; color: var(--faint); margin: 18px 10px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: 8px; color: var(--fg);
  text-decoration: none; font-weight: 500; font-size: 13.5px; transition: background .12s;
}
.nav-item svg { color: var(--faint); width: 18px; height: 18px; }
.nav-item span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item:hover { background: var(--hover); }
.nav-item[aria-current="page"] { background: var(--select); font-weight: 600; }
.nav-item[aria-current="page"] svg { color: var(--fg); }
.nav-item.label svg, .nav-item.label[aria-current="page"] svg { color: var(--tag); }
.nav-item .num { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.nav-item .num.strong { color: var(--accent-strong); font-weight: 650; }
/* Unread mail in a mailbox or label: its name and count in bold, as in Front. */
.nav-item.has-unread { font-weight: 650; }
.nav-item.has-unread .num { color: var(--fg); font-weight: 650; }
.scrim { display: none; }

/* ---------- List ---------- */
.list-col { display: flex; flex-direction: column; min-height: 0; background: var(--list); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.list-top { display: none; gap: 6px; align-items: center; padding: 10px 12px 4px; }
.menu { display: none; }
.search-trigger {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--faint); text-align: left;
}
.search-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-trigger svg { width: 17px; height: 17px; }
.banner { display: flex; align-items: center; gap: 10px; margin: 8px 12px 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); font-size: 13px; }
.banner span { flex: 1; }
.banner.soft { background: var(--surface); border: 1px solid var(--line); color: var(--fg); margin: 0 0 8px; }
.list { overflow-y: auto; flex: 1; min-height: 0; padding-bottom: 12px; }
.list h2 {
  font-size: 17px; font-weight: 700; letter-spacing: -.02em; margin: 0; padding: 16px 20px 10px; display: flex; gap: 10px; align-items: baseline;
  position: sticky; top: 0; background: var(--list); z-index: 1; min-width: 0;
}
.list h2 .query { font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.list h2 .link { margin-left: auto; }
.count { font-size: 12.5px; font-weight: 500; color: var(--faint); letter-spacing: 0; }
.list > .banner.soft { margin: 0 12px 8px; }
.rows { display: grid; gap: 1px; padding: 0 8px; }
.row {
  position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 11px; padding: 11px 12px; border-radius: 10px;
  text-decoration: none; color: var(--fg); border: 1.5px solid transparent; transition: background .1s, border-color .1s;
}
.row.plain { grid-template-columns: minmax(0, 1fr); padding: 12px 14px 12px 32px; }
.row.plain.unread::before { left: 13px; }
/* Hairlines between rows, as in Front, hidden around the hovered or open one. */
.row::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1.5px; height: 1px; background: var(--line); }
.row:last-of-type::after, .row[aria-current="true"]::after, .row:has(+ .row[aria-current="true"])::after { display: none; }
/* Hover only where there is a pointer: on a phone, a tap that reveals something is taken as a hover by Safari and
   doesn't open the email. */
@media (hover: hover) {
  .row:hover::after, .row:has(+ .row:hover)::after { display: none; }
  .row:hover { background: var(--surface-3); }
  .row:hover .row-actions { display: flex; }
  .row:hover .row-check { display: grid; }
}
.row[aria-current="true"] { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 75%, transparent); }
.row-main { min-width: 0; display: grid; gap: 2px; }
.row-line { display: flex; gap: 8px; align-items: center; min-width: 0; }
.row .from { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); font-weight: 550; }
.row .from .n { color: var(--faint); font-size: 12px; font-weight: 500; }
.row time { color: var(--faint); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row .subj { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); }
.row .snip { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font-size: 13px; }
.row .snip.quote { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--muted); }
.row.unread .from { color: var(--fg); font-weight: 650; }
.row.unread .subj { font-weight: 600; }
.row.unread::before { content: ""; position: absolute; left: 9px; top: 20px; width: 7px; height: 7px; border-radius: 50%; background: var(--unread); }
.row.plain:not(.unread) .subj { color: var(--fg); }
.row.note.unread { background: color-mix(in srgb, var(--accent-soft) 50%, transparent); }
.row.note .from { color: var(--fg); font-weight: 500; }
.marks, .team { display: inline-flex; gap: 4px; align-items: center; flex: none; color: var(--faint); }
.marks svg { width: 15px; height: 15px; }
.chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 500; color: var(--muted); background: var(--surface-3); border-radius: 999px; padding: 1px 7px; }
.chip svg { width: 12px; height: 12px; }
.chip.ok { color: var(--ok); background: var(--ok-soft); }
.chip.faint { color: var(--faint); background: none; padding: 0; }
.dot-new { width: 7px; height: 7px; border-radius: 50%; background: var(--internal); }
/* Quick actions on hover, as in Front. */
.row-actions {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: none; flex-direction: column; gap: 2px; padding: 3px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--raised);
}
.row-actions.open { display: flex; }
.row time.until { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-strong); font-weight: 550; }
.row time.until svg { width: 13px; height: 13px; }
.row-actions .icon-btn { width: 28px; height: 28px; }
.row-actions svg { width: 16px; height: 16px; }
.more { border: 0; background: none; color: var(--accent-strong); padding: 14px; font-weight: 550; }
.empty { padding: 36px 18px; color: var(--muted); text-align: center; }
.empty.error p { margin: 0 0 8px; }
.empty.error .fine { overflow-wrap: anywhere; }
.skeleton i { display: block; height: 10px; border-radius: 5px; background: var(--surface-3); margin: 6px 0; }
.skeleton i:nth-child(2) { width: 70%; }
.skeleton .av { background: var(--surface-3); }

/* ---------- Conversation ---------- */
.pane-col { min-width: 0; min-height: 0; background: var(--pane); }
.pane-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 4px; color: var(--muted); text-align: center; padding: 24px; }
.pane-empty img { opacity: .35; filter: grayscale(.5); margin-bottom: 10px; }
.pane-empty p { margin: 0; }
.pane { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.pane-top { background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px 8px 24px; container-type: inline-size; }
.toolbar { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.pane-title { flex: 1 1 0; min-width: 120px; margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0 2px; font-size: 12.5px; color: var(--muted); }
.pane-sub .meta { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; }
.pane-sub a.meta:hover { color: var(--accent-strong); }
.pane-sub .meta svg { width: 14px; height: 14px; }
.pane-sub .add-label { width: 24px; height: 24px; border-radius: 7px; }
.pane-sub .add-label svg { width: 16px; height: 16px; }
.pane-sub a.meta { margin-left: auto; }
.tool-group { display: flex; align-items: center; gap: 2px; }
.team-tools { gap: 8px; }
.back { display: none; }
.assign-wrap { position: relative; }
.assign {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: 8px; padding: 0 8px 0 8px; color: var(--fg); font-weight: 550; font-size: 13.5px;
}
.assign.set { border-style: solid; color: var(--fg); }
.assign svg:last-child { width: 16px; height: 16px; }
.assign:hover { border-color: var(--faint); }
.followers { display: inline-flex; padding-left: 6px; }
.followers .av { margin-left: -6px; box-shadow: 0 0 0 2px var(--page); }
.more-n { font-size: 11px; color: var(--muted); margin-left: 4px; align-self: center; }
.pane-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 28px 28px; }
.pane-head { max-width: 880px; margin: 0 auto 16px; }
.pane-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; margin: 0 0 6px; text-wrap: balance; overflow-wrap: anywhere; }
.pane-head .sub { color: var(--muted); font-size: 12.5px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.pane-head .sub a, .pane-head .sub span { display: inline-flex; gap: 4px; align-items: center; }
.pane-head .sub a { text-decoration: none; }
.pane-head .sub svg { width: 14px; height: 14px; }
.timeline { max-width: 880px; margin: 0 auto; display: grid; gap: 12px; }

.mail { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; min-width: 0; box-shadow: 0 1px 2px rgba(16, 24, 40, .03); }
.mail header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.mail .who { min-width: 0; line-height: 1.35; }
.mail .who .name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail .to { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.mail-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.mail-meta > svg { width: 16px; height: 16px; color: var(--faint); }
.mail-meta time { font-size: 12.5px; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.mail-actions { display: flex; opacity: .75; }
.mail:hover .mail-actions { opacity: 1; }
.mail-actions .icon-btn { width: 30px; height: 30px; }
.mail .body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 14px; line-height: 1.6; }
.mail.collapsed {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; text-align: left;
  padding: 12px 18px; color: var(--fg); width: 100%; font: inherit; cursor: pointer;
}
.mail.collapsed b { font-weight: 600; }
.mail.collapsed .snip { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail.collapsed time { color: var(--faint); font-size: 12.5px; }
.mail.collapsed > svg { width: 15px; height: 15px; color: var(--faint); }
.mail.collapsed:hover { border-color: var(--line-strong); }
.frame-wrap { margin-top: 14px; border-radius: 8px; overflow: hidden; }
/* "Original colours" in dark mode: the email on its own white sheet. */
@media (prefers-color-scheme: dark) { .frame-wrap.light { background: #fff; padding: 12px 14px; } }
.frame-wrap iframe { display: block; width: 100%; border: 0; min-height: 40px; }

.seen-wrap { position: relative; }
.seen { border: 0; border-radius: 999px; height: 22px; padding: 0 9px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--muted); }
.seen.yes { background: color-mix(in srgb, #6d5df5 16%, var(--surface)); color: #4b3fd1; }
@media (prefers-color-scheme: dark) { .seen.yes { color: #b4abff; background: color-mix(in srgb, #6d5df5 30%, var(--surface)); } }
.seen-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--pop); overflow: hidden; }
.seen-pop header { display: block; padding: 12px 16px; font-weight: 650; text-align: center; border-bottom: 1px solid var(--line); }
.seen-pop ul { list-style: none; margin: 0; padding: 6px 0; max-height: 280px; overflow-y: auto; }
.seen-pop li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 16px; color: var(--fg); font-size: 13px; }
.seen-pop li time { color: var(--faint); font-variant-numeric: tabular-nums; }

.files { margin-top: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.files-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 13px; }
.files-head b { font-weight: 600; }
.tiles { display: flex; gap: 10px; flex-wrap: wrap; }
.tile {
  width: 160px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--fg);
  display: grid; grid-template-rows: 96px auto auto; background: var(--surface); transition: border-color .12s, box-shadow .12s;
}
.tile:hover { border-color: var(--line-strong); box-shadow: var(--raised); }
.tile .thumb { display: grid; place-items: center; background: var(--surface-2); overflow: hidden; border-bottom: 1px solid var(--line); }
.tile .thumb img { width: 100%; height: 100%; object-fit: cover; }
.tile .ext { font-weight: 700; font-size: 11.5px; letter-spacing: .04em; color: #fff; background: var(--faint); border-radius: 7px; padding: 6px 8px; }
.tile .ext.pdf { background: #e5483f; }
.tile .ext.doc, .tile .ext.docx { background: #2f6fe4; }
.tile .ext.xls, .tile .ext.xlsx, .tile .ext.csv { background: #1e9455; }
.tile .ext.ppt, .tile .ext.pptx { background: #e0662c; }
.tile .ext.zip { background: #7a5bd0; }
.tile-name { padding: 7px 10px 0; font-size: 12.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-size { padding: 0 10px 8px; font-size: 11.5px; color: var(--faint); }

.comment { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding-left: 28px; }
.bubble { background: var(--internal-soft); border: 1px solid var(--internal-line); border-radius: 4px 14px 14px 14px; padding: 9px 13px 11px; min-width: 0; }
.bubble header { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.bubble header b { font-weight: 650; }
.bubble time { color: var(--muted); font-size: 12px; margin-left: auto; }
.internal { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 650; color: var(--internal); }
.internal svg { width: 12px; height: 12px; }
.bubble .text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 3px; line-height: 1.55; }
.mention { color: var(--mention); background: var(--mention-bg); border-radius: 6px; padding: 0 4px; font-weight: 600; white-space: nowrap; }
.event { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; padding: 0 0 0 32px; }
.event > span:not(.av) { flex: 1; min-width: 0; }
.event b { font-weight: 600; color: var(--fg); }
.event time { color: var(--faint); font-size: 12px; }
.event.draft { text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-left: 28px; color: var(--fg); }
.event.draft svg { color: var(--accent-strong); }
.label-chip { --tag: var(--faint); display: inline-flex; align-items: center; gap: 5px; height: 24px; border: 1px solid var(--line); background: var(--surface); border-radius: 7px; padding: 0 6px 0 7px; font-size: 12.5px; font-weight: 550; color: var(--fg); }
.picker .dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.label-chip svg { width: 12px; height: 12px; color: var(--faint); }
.label-chip svg:first-child { width: 15px; height: 15px; color: var(--tag); }
.label-chip:hover svg:last-child:not(:first-child) { color: var(--fg); }
.label-chip.done-chip { --tag: var(--ok); }
.label-chip.star-chip { --tag: var(--star); }
.label-chip.snoozed { --tag: var(--accent); color: var(--accent-strong); }
.pane-sub .sep { width: 1px; height: 16px; background: var(--line-strong); }
/* Who sees the comments: where Front shows the inbox. */
.people-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; border: 1px solid var(--line); background: var(--surface); border-radius: 7px;
  padding: 0 8px 0 6px; font-size: 12.5px; font-weight: 550; color: var(--fg);
}
.people-chip:hover { border-color: var(--line-strong); background: var(--surface-2); }
.people-chip svg { width: 14px; height: 14px; color: var(--accent); }
.people-chip .av { box-shadow: 0 0 0 2px var(--surface); }
.people-chip .av + .av { margin-left: -8px; }
.pane-sub .picker { left: 0; right: auto; }

/* ---------- Composer: a floating card at the bottom ---------- */
.dock { padding: 10px 20px calc(16px + env(safe-area-inset-bottom)); }
.dock-tabs, .reply-form, .dock .composer { max-width: 880px; margin: 0 auto; }
.dock.replying .reply-form { margin-bottom: 10px; }
.dock-tabs { display: flex; gap: 4px; align-items: center; margin-bottom: 8px; }
.dock-tab { display: inline-flex; align-items: center; gap: 6px; height: 30px; border: 0; background: none; border-radius: 8px; padding: 0 10px; color: var(--muted); font-weight: 550; font-size: 13px; }
.dock-tab:hover { background: var(--hover); color: var(--fg); }
.dock-tab svg { width: 16px; height: 16px; }
.dock-tab[aria-selected="true"] { color: var(--accent-strong); background: var(--accent-soft); }
.close-dock { margin-left: auto; }
.reply-form, .composer { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--raised); position: relative; }
.reply-form:focus-within, .composer:focus-within { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.field { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding: 0 14px; position: relative; }
.field > span { color: var(--faint); font-size: 13px; width: 52px; flex: none; }
.field input { flex: 1; min-width: 0; border: 0; background: none; padding: 10px 0; outline: none; }
.field .add-cc { flex: none; }
.reply-form textarea, .modal textarea { display: block; width: 100%; border: 0; resize: vertical; padding: 12px 14px; background: none; outline: none; min-height: 110px; max-height: 45vh; line-height: 1.6; }
.reply-form footer, .modal footer, .composer footer { display: flex; align-items: center; gap: 8px; padding: 8px 10px 10px 14px; }
.hint { color: var(--faint); font-size: 12px; flex: 1; }
/* The comment bar (Front): one line that grows as you type, tools on the right, amber once you write. */
.comment-bar { display: flex; align-items: flex-end; gap: 4px; padding: 4px 6px 4px 0; box-shadow: var(--shadow); }
.comment-bar:focus-within, .comment-bar.typing { border-color: var(--internal-line); background: var(--internal-soft); box-shadow: var(--raised); }
.comment-bar .ph { position: absolute; left: 16px; top: 13px; color: var(--muted); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; right: 130px; }
.comment-bar .ph b { color: var(--faint); font-weight: 400; }
.editor { flex: 1; min-width: 0; min-height: 22px; max-height: 200px; overflow-y: auto; padding: 9px 4px 9px 16px; outline: none; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.comment-bar.expanded .editor { min-height: 160px; max-height: 50vh; }
.bar-tools { display: flex; align-items: center; gap: 2px; flex: none; padding-bottom: 1px; }
.bar-tools .icon-btn { width: 32px; height: 32px; }
.bar-tools .post { height: 32px; margin-left: 4px; }
.emoji-pop {
  position: absolute; right: 8px; bottom: calc(100% + 8px); z-index: 30; display: grid; grid-template-columns: repeat(8, 34px); gap: 2px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--pop);
}
.emoji-pop button { width: 34px; height: 34px; border: 0; background: none; border-radius: 8px; font-size: 19px; line-height: 1; }
.emoji-pop button:hover { background: var(--hover); }
.mail-foot { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.mail-foot .btn { height: 36px; padding: 0 14px; }
.flip-i { display: inline-flex; transform: scaleX(-1); }
.people-strip { display: inline-flex; align-items: center; gap: 4px; padding: 0 2px 0 8px; height: 32px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.people-strip .av { box-shadow: 0 0 0 2px var(--surface); }
.people-strip .av + .av { margin-left: -6px; }
.people-strip .only-me { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 550; color: var(--muted); padding-left: 2px; white-space: nowrap; }
.people-strip .only-me svg { width: 14px; height: 14px; }
.people-strip .add-person { width: 26px; height: 26px; border-radius: 6px; }
.people-strip .add-person svg { width: 16px; height: 16px; }
.sig-pick { padding: 4px 14px 0; display: grid; gap: 6px; }
.sig-pick label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.sig-pick svg { width: 15px; height: 15px; }
.sig-pick select { border: 0; background: none; color: var(--muted); font-size: 12.5px; padding: 2px 0; cursor: pointer; }
.sig-preview { border-left: 2px solid var(--line); padding: 2px 0 2px 10px; background: #fff; border-radius: 4px; overflow: hidden; }
.sig-preview.big { border: 1px solid var(--line); padding: 14px 16px; border-radius: 12px; }
.fit-frame { display: block; width: 100%; border: 0; }
.forwarded { margin: 8px 14px 0; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; color: var(--muted); font: 12.5px/1.5 var(--font); white-space: pre-wrap; max-height: 180px; overflow: auto; }

/* ---------- Pickers and popups ---------- */
.pop, .picker, .suggest { position: absolute; z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--pop); width: 300px; max-width: calc(100vw - 32px); padding: 6px; }
.dock .pop { transform: translateY(calc(-100% - 34px)); }
.picker { right: 0; top: calc(100% + 6px); }
.picker.labels { width: 260px; }
.picker.menu { width: 240px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
.picker.menu button { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 8px; border: 0; background: none; border-radius: 8px; color: var(--fg); font-weight: 500; text-align: left; }
.picker.menu button:hover { background: var(--surface-3); }
.picker.menu button svg { width: 17px; height: 17px; color: var(--faint); }
.picker.menu button span { flex: 1; }
.picker.menu kbd { font-size: 10.5px; padding: 1px 5px; }
/* On hover, the quick actions take the time's place. */
@media (hover: hover) { .row.plain:hover time { visibility: hidden; } }
.suggest { left: 60px; top: 100%; list-style: none; margin: 0; }
.picker input { width: 100%; border: 1px solid var(--line); border-radius: 9px; height: 34px; padding: 0 10px; margin-bottom: 4px; background: var(--surface); outline: none; }
.picker input:focus { border-color: var(--accent); }
.pop ul, .picker ul { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; }
.pop li, .picker li, .suggest li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; cursor: pointer; }
.pop li[aria-selected="true"], .pop li:hover, .picker li[aria-selected="true"], .picker li:hover, .suggest li[aria-selected="true"], .suggest li:hover { background: var(--accent-soft); }
.pop li > div, .picker li > div, .suggest li > div { min-width: 0; flex: 1; }
.n { font-weight: 550; }
.e { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { margin-left: auto; font-size: 11px; font-weight: 550; color: var(--accent-strong); white-space: nowrap; }
.picker li svg { color: var(--accent-strong); }
.picker .unassign { color: var(--muted); border-top: 1px solid var(--line); border-radius: 0 0 9px 9px; margin-top: 4px; }
.picker .none, .pop .none { padding: 10px; color: var(--muted); cursor: default; }

/* ---------- Settings ---------- */
.prefs { padding: 0 18px 6px; }
.prefs .check { align-items: flex-start; }
.prefs .check input { margin-top: 3px; }
.prefs small { color: var(--muted); font-size: 12px; }
.settings-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 18px 8px; }
.list-sub { font-size: 12px; font-weight: 600; color: var(--faint); margin: 16px 18px 6px; }
.empty.small { padding: 4px 18px 10px; text-align: left; font-size: 13px; }
.sig-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
.sig-icon svg { width: 16px; height: 16px; }
.settings-form { max-width: 720px; margin: 0 auto; display: grid; gap: 18px; }
.settings-form h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.settings-form > .fine { margin: -12px 0 0; }
.form-field { display: grid; gap: 6px; }
.form-field > span { font-weight: 600; font-size: 13px; }
.form-field small { color: var(--faint); font-size: 12px; }
.form-field input { border: 1px solid var(--line-strong); border-radius: 10px; height: 38px; padding: 0 12px; background: var(--surface); outline: none; }
.form-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; gap: 8px; align-items: center; }

/* ---------- Dialogs, toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(12, 14, 20, .4); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-back.top { place-items: start center; padding-top: 12vh; }
.modal { background: var(--surface); border-radius: 18px; box-shadow: var(--pop); width: 100%; max-width: 660px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: visible; }
.modal.small { max-width: 440px; }
.modal.small:has(.keys-groups) { max-width: 1000px; }
.modal > header { display: flex; align-items: center; padding: 14px 14px 14px 20px; border-bottom: 1px solid var(--line); }
.modal h2 { margin: 0; font-size: 16px; font-weight: 700; flex: 1; }
.switcher { padding: 8px; }
.switcher input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 10px 10px 12px; font-size: 16px; outline: none; background: none; }
.switcher ul { list-style: none; margin: 6px 0 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.switcher li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.switcher li small { color: var(--faint); }
.switcher li[aria-selected="true"], .switcher li:hover { background: var(--accent-soft); }
.keys-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 4px 24px; padding: 6px 20px 0; max-height: calc(100vh - 160px); overflow-y: auto; }
.keys-groups h3 { margin: 12px 0 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); }
.keys { display: grid; grid-template-columns: 110px 1fr; gap: 8px 16px; padding: 4px 0; margin: 0; }
.keys dt { text-align: right; }
.keys dd { margin: 0; color: var(--muted); }
.keys-note { padding: 8px 20px 16px; margin: 0; }
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 16px;
  background: var(--snack); color: var(--on-snack); border-radius: 12px; padding: 12px 16px; box-shadow: var(--pop); z-index: 60;
  max-width: calc(100vw - 32px); overflow: hidden; font-weight: 500;
}
.toast > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast .undo { border: 0; background: none; color: var(--accent); font-weight: 700; padding: 0; }
@media (prefers-color-scheme: dark) { .toast .undo { color: var(--accent-strong); filter: brightness(.7); } }
.toast .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); width: 100%; transform-origin: left; animation: drain linear forwards; }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- Smaller screens ---------- */
@media (max-width: 1180px) {
  .app { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); }
  .list-col { border-left: 0; }
  .nav { position: fixed; inset: 0 auto 0 0; z-index: 40; transform: translateX(-100%); transition: transform .18s ease-out; }
  .app.drawer .nav { transform: none; box-shadow: var(--pop); }
  .app.drawer .scrim { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(12, 14, 20, .35); }
  .menu { display: inline-grid; }
  .list-top { display: flex; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .app.has-item .list-col { display: none; }
  .app:not(.has-item) .pane-col { display: none; }
  .list-col { border: 0; }
  .back { display: inline-grid; }
  .pane-scroll { padding: 14px 12px 20px; }
  .comment, .event.draft { padding-left: 0; margin-left: 0; }
  .event { padding-left: 4px; }
  .mail { padding: 14px; }
  .mail-meta time { display: none; }
  .dock { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
  .team-tools .btn { padding: 0 10px; }
  .followers { display: none; }
  .row-actions { display: none !important; }
  .modal-back { padding: 0; place-items: end stretch; }
  .modal { max-height: 100%; height: 100%; border-radius: 0; max-width: none; }
  .modal.small { height: auto; border-radius: 18px 18px 0 0; }
  .list-top, .pane-top { padding-top: max(10px, env(safe-area-inset-top)); }
  .pane-top { padding-left: 10px; padding-right: 10px; }
}
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: rise .18s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }
}
.sig-problems { background: var(--internal-soft); border: 1px solid var(--internal-line); color: var(--internal); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; }
.sig-problems p { margin: 2px 0; overflow-wrap: anywhere; }

/* ---------- Signature editor (like Front's) ---------- */
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 550; }
.crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--fg); }
.crumbs svg { width: 16px; height: 16px; color: var(--faint); }
.settings-form.front { max-width: 860px; gap: 22px; }
.settings-form.front h1 { display: flex; align-items: center; gap: 10px; font-size: 24px; }
.title-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-strong); }
.title-icon svg { width: 17px; height: 17px; }
.settings-form.front .form-field { gap: 8px; }
.settings-form.front .form-field > span { font-size: 14px; color: var(--muted); }
.settings-form.front .form-field input { max-width: 520px; height: 40px; background: var(--surface-3); border-color: transparent; border-radius: 10px; font-size: 14.5px; }
.settings-form.front .form-field input:focus { background: var(--surface); border-color: var(--accent); }
.settings-form.front .form-field small { font-size: 13px; color: var(--faint); }
.inline-field { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.inline-field select { height: 38px; border: 0; border-radius: 10px; background: var(--surface-3); padding: 0 12px; font-weight: 500; color: var(--fg); }
.sig-editor { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); overflow: visible; }
.sig-canvas { display: block; width: 100%; border: 0; border-radius: 16px 16px 0 0; background: #fff; }
.sig-html { display: block; width: 100%; min-height: 260px; border: 0; border-radius: 16px 16px 0 0; padding: 18px 22px; font: 12.5px/1.6 ui-monospace, Menlo, Consolas, monospace; resize: vertical; outline: none; background: var(--surface); }
.sig-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 8px 10px; border-top: 1px solid var(--line); }
.sig-tools select { height: 34px; border: 0; border-radius: 9px; background: var(--surface-3); padding: 0 10px; font-size: 13.5px; min-width: 140px; color: var(--fg); }
.sig-tools select.narrow { min-width: 64px; }
.sig-tools .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.sig-tools .color { position: relative; display: inline-grid; place-items: center; width: 40px; height: 34px; border-radius: 9px; background: var(--surface-3); color: var(--muted); cursor: pointer; }
.sig-tools .color input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sig-bottom { display: flex; align-items: center; gap: 8px; padding: 8px 10px 10px; border-top: 1px solid var(--line); }
.sig-bottom .grow { flex: 1; }
.sig-bottom .vars { height: 34px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); padding: 0 10px; font-size: 13px; color: var(--fg); }
.edit-using { display: inline-flex; align-items: center; gap: 8px; color: var(--faint); font-size: 13.5px; }
.edit-using select { height: 34px; border: 0; border-radius: 9px; background: var(--surface-3); padding: 0 10px; font-size: 13.5px; font-weight: 500; color: var(--fg); }
.emoji-wrap { position: relative; }
.emoji-pop.up { left: 0; right: auto; bottom: calc(100% + 8px); }
/* Settings tabs and message templates (Front). */
.tabs { display: flex; gap: 18px; padding: 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.tabs a { padding: 8px 0 10px; color: var(--muted); text-decoration: none; font-weight: 550; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--fg); border-color: var(--fg); }
.tpl-head { display: flex; gap: 8px; padding: 2px 18px 12px; align-items: center; }
.searchbox { flex: 1; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: 10px; background: var(--surface-3); color: var(--faint); }
.searchbox svg { width: 17px; height: 17px; flex: none; }
.searchbox input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 14px; color: var(--fg); }
.row .lock { display: inline-flex; color: var(--faint); }
.row .lock svg, .tpl-pop .lock svg { width: 13px; height: 13px; }
.row .date { margin-left: auto; color: var(--faint); font-size: 12px; flex: none; }
.row .avail { color: var(--faint); font-size: 12px; }
.crumbs .org { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-strong); font-size: 11.5px; font-weight: 700; }
.req { color: #d64545; font-style: normal; }
.form-field code { font-size: 12px; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.setting-row b { display: block; font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.setting-row small { color: var(--faint); font-size: 13px; }
.switch { position: relative; flex: none; width: 46px; height: 26px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + span { opacity: .55; }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.sig-editor { position: relative; }
.img-frame { position: absolute; z-index: 30; outline: 2px solid var(--accent); outline-offset: 1px; pointer-events: none; }
.img-handle { position: absolute; right: -7px; bottom: -7px; width: 12px; height: 12px; border: 2px solid #fff; border-radius: 3px; background: var(--accent); cursor: nwse-resize; pointer-events: auto; touch-action: none; }
.img-sizes { position: absolute; z-index: 40; display: flex; align-items: center; gap: 4px; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--pop); font-size: 13px; }
.img-sizes button { border: 0; border-radius: 7px; background: var(--surface-3); color: var(--fg); padding: 5px 9px; font-size: 13px; cursor: pointer; }
.img-sizes button:hover { background: var(--line); }
.img-sizes label { display: flex; align-items: center; gap: 5px; padding: 0 4px 0 8px; color: var(--muted); }
.img-sizes input { width: 64px; height: 28px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--fg); padding: 0 6px; font-size: 13px; }
.var-pop { width: 260px; max-height: 260px; overflow-y: auto; list-style: none; margin: 0; }
.var-pop li { font-size: 13.5px; color: var(--muted); padding: 7px 10px; }
.tpl-anchor { position: relative; display: grid; }
.tpl-pop { position: absolute; z-index: 40; left: 10px; top: 34px; width: 360px; max-width: calc(100% - 20px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--pop); display: flex; flex-direction: column; max-height: 360px; }
.tpl-pop header { display: flex; align-items: center; justify-content: center; position: relative; padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 600; }
.tpl-pop header .icon-btn { position: absolute; right: 6px; width: 28px; height: 28px; }
.tpl-pop .searchbox { flex: none; margin: 8px 10px 0; }
.tpl-pop ul { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.tpl-pop li { display: flex; align-items: flex-start; gap: 10px; padding: 8px; border-radius: 9px; cursor: pointer; }
.tpl-pop li > div { min-width: 0; flex: 1; }
.tpl-pop li .n { display: flex; align-items: center; gap: 5px; }
.tpl-pop li .lock { display: inline-flex; color: var(--faint); }
.tpl-pop li[aria-selected="true"] { background: var(--accent-soft); }
.tpl-pop li.group { font-size: 12px; font-weight: 600; color: var(--faint); padding: 8px 8px 4px; cursor: default; background: none; }
.tpl-i { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--surface-3); color: var(--muted); flex: none; margin-top: 2px; }
.tpl-i svg { width: 15px; height: 15px; }
.tpl-pop .fine { padding: 12px 14px; margin: 0; }
.tpl-pop footer { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); }
.tpl-pop footer a { color: var(--accent-strong); text-decoration: none; }
/* The reply box sits at the bottom of the screen: its picker opens upward. */
.reply-form .tpl-pop { top: auto; bottom: calc(100% + 4px); }
/* What Gemini searched for, above search results. */
.search-info { margin: -4px 18px 10px; font-size: 12.5px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.search-info code { font: 12px ui-monospace, Menlo, Consolas, monospace; background: var(--surface-3); color: var(--fg); padding: 1px 6px; border-radius: 6px; }
.search-info .spark { color: var(--accent-strong); margin-right: 5px; }
.search-info.fallback { color: var(--internal); }
.search-info .search-switch { margin-left: 10px; color: var(--accent-strong); text-decoration: none; font-weight: 500; white-space: nowrap; }
.search-info .search-switch:hover { text-decoration: underline; }
/* Gemini's answer to a question about the emails. */
.gemini-answer { margin: 0 12px 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.gemini-answer header { display: flex; align-items: baseline; gap: 6px; font-weight: 650; font-size: 13px; margin-bottom: 6px; }
.gemini-answer header .spark { color: var(--accent-strong); }
.gemini-answer header small { color: var(--faint); font-weight: 450; margin-left: auto; }
.gemini-answer .answer { margin: 0; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.gemini-answer .reading { margin: 0; color: var(--muted); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.gemini-answer .sources { list-style: none; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.gemini-answer .sources a { display: block; font-size: 12.5px; color: var(--muted); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gemini-answer .sources a:hover { color: var(--accent-strong); }
.gemini-answer .sources b { color: var(--fg); font-weight: 600; }
.gemini-answer .evidence { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.gemini-answer .evidence a { display: block; text-decoration: none; font-size: 12.5px; color: var(--muted); border-left: 2px solid var(--accent); padding: 2px 0 2px 8px; }
.gemini-answer .evidence q { color: var(--fg); font-style: italic; }
.gemini-answer .evidence a:hover q { color: var(--accent-strong); }
.gemini-answer .unverified { margin: 8px 0 0; font-size: 12.5px; color: var(--internal); background: var(--internal-soft); border: 1px solid var(--internal-line); border-radius: 8px; padding: 6px 9px; }
/* Read receipts toggle next to Send: struck through when off. */
.icon-btn.track { position: relative; color: var(--faint); }
.icon-btn.track:not(.on)::after { content: ''; position: absolute; left: 9px; right: 9px; top: 50%; height: 1.5px; background: currentColor; transform: rotate(-35deg); }
.icon-btn.track.on { color: var(--accent-strong); background: var(--accent-soft); }
/* ---------- Search: a panel over the app, as in Front ---------- */
.search-back { position: fixed; inset: 0; z-index: 55; background: rgba(14, 14, 28, .1); }
.search-panel {
  position: absolute; top: 10px; left: 304px; width: min(780px, calc(100vw - 320px)); max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--pop); overflow: hidden;
}
.search-input { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--line); }
.search-input > svg { width: 20px; height: 20px; color: var(--faint); }
.search-input input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; }
.search-input input::placeholder { color: var(--faint); }
.gemini-pill { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 12px; font-weight: 600; color: var(--accent-strong); background: var(--accent-soft); border-radius: 999px; padding: 3px 10px 3px 8px; }
.gemini-pill svg { width: 12px; height: 12px; }
.search-options { list-style: none; margin: 0; padding: 6px 8px 8px; overflow-y: auto; }
.search-options li { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; cursor: pointer; min-width: 0; }
.search-options li > svg { width: 18px; height: 18px; color: var(--faint); }
.search-options li[aria-selected="true"] { background: var(--surface-3); }
.search-options li[aria-selected="true"] > svg { color: var(--accent); }
.search-options .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-options .t b { font-weight: 600; }
.search-options .t .e { color: var(--faint); font-size: 12.5px; }
.search-options small { color: var(--faint); font-size: 12px; flex: none; }
.search-options code { font: 12.5px ui-monospace, Menlo, Consolas, monospace; background: var(--surface-3); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; margin-right: 4px; }
.search-options li.group { font-size: 12px; font-weight: 600; color: var(--faint); padding: 12px 10px 4px; cursor: default; background: none; }
.search-panel footer { display: flex; justify-content: space-between; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); background: var(--surface-2); }
.search-panel footer kbd { font-size: 10.5px; padding: 1px 5px; }
@media (max-width: 1180px) {
  .search-panel { left: 12px; width: calc(100vw - 24px); }
}
@media (max-width: 760px) {
  .search-panel { top: 0; left: 0; width: 100vw; max-height: 100vh; border-radius: 0 0 14px 14px; }
  .search-panel footer { display: none; }
}
/* A narrow conversation column: the subject keeps its line, the team tools go on the next one. */
@container (max-width: 820px) {
  .toolbar { flex-wrap: wrap; row-gap: 8px; }
  .team-tools { flex-basis: 100%; flex-wrap: wrap; }
}
/* ---------- Snooze times (Front's H) ---------- */
.picker.snooze-pop { width: 290px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; outline: none; }
.snooze-pop header { padding: 6px 8px 8px; font-size: 12.5px; font-weight: 600; color: var(--faint); }
.snooze-pop header b { color: var(--fg); }
.snooze-pop > button { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 8px; border: 0; background: none; border-radius: 8px; color: var(--fg); font-weight: 500; text-align: left; }
.snooze-pop > button span { flex: 1; }
.snooze-pop > button small { color: var(--faint); font-size: 12.5px; }
.snooze-pop > button:hover, .snooze-pop > button[aria-selected="true"] { background: var(--surface-3); }
.snooze-pop .custom { display: flex; gap: 6px; padding: 8px 4px 4px; margin-top: 4px; border-top: 1px solid var(--line); }
.snooze-pop .custom input { flex: 1; min-width: 0; height: 32px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; background: var(--surface); font-size: 13px; }
.snooze-pop .unsnooze { margin-top: 4px; border-top: 1px solid var(--line) !important; border-radius: 0 0 8px 8px !important; color: var(--accent-strong) !important; }
.snooze-pop .unsnooze svg { width: 17px; height: 17px; }
/* ---------- Assistant ---------- */
.side-head .gemini-pill { margin-right: 4px; }
.ai-group { display: flex; align-items: center; gap: 6px; margin: 14px 20px 4px; font-size: 12px; font-weight: 600; color: var(--faint); }
.ai-group .count { font-size: 12px; }
.ai-group.customers { color: var(--accent-strong); }
.ai-group .link { display: inline-flex; align-items: center; gap: 6px; color: var(--faint); font-size: 12px; font-weight: 600; }
.ai-group .link svg { width: 14px; height: 14px; }
.ai-section:first-of-type .ai-group { margin-top: 2px; }
.row .why { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .why svg { width: 11px; height: 11px; color: var(--accent); flex: none; }
.chip.todo-chip { color: var(--accent-strong); background: var(--accent-soft); }
.todos { list-style: none; margin: 0; padding: 0 8px; display: grid; gap: 2px; }
.todos li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 8px 10px 12px; border-radius: 10px; border: 1.5px solid transparent; }
.todos li:hover { background: var(--surface-3); }
.todos li.current { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 75%, transparent); }
.todos li > a { flex: 1; min-width: 0; display: grid; gap: 3px; text-decoration: none; color: var(--fg); }
.todos .what { font-weight: 550; line-height: 1.4; }
.todos .where { font-size: 13px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todos .where b, .todo-line b { font-weight: 600; color: var(--accent-strong); margin-right: 6px; }
.todos .where b.late, .todo-line b.late { color: var(--danger); }
.todos .icon-btn { width: 28px; height: 28px; opacity: 0; }
.todos li:hover .icon-btn { opacity: 1; }
.tick { flex: none; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: transparent; padding: 0; }
.tick svg { width: 14px; height: 14px; stroke-width: 2.5; }
.tick:hover { border-color: var(--accent); color: var(--accent); }
.ai-intro { margin: 8px 16px; padding: 22px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); display: grid; gap: 10px; justify-items: start; }
.ai-intro h3 { margin: 0; font-size: 16px; }
.ai-intro p { margin: 0; color: var(--muted); line-height: 1.55; }
.ai-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.ai-mark svg { width: 20px; height: 20px; }
.ai-setup textarea.about { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 14px; background: var(--surface); line-height: 1.55; resize: vertical; outline: none; }
.ai-setup textarea.about:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ai-setup .setting-row { border-top: 0; padding-top: 0; }
.ai-setup .setting-row small { display: block; max-width: 560px; line-height: 1.5; }
.thread-todos { max-width: 880px; margin: 0 auto 12px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--accent) 4%, var(--surface)); display: grid; gap: 6px; }
.thread-todos header { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--accent-strong); }
.thread-todos header svg { width: 13px; height: 13px; }
.todo-line { display: flex; align-items: center; gap: 10px; }
.todo-line > span { flex: 1; min-width: 0; }
.todo-line .icon-btn { width: 26px; height: 26px; }
.ai-draft-btn { display: inline-flex; align-items: center; gap: 6px; margin: 8px 14px 0; border: 0; background: var(--accent-soft); color: var(--accent-strong); border-radius: 999px; padding: 4px 12px 4px 10px; font-size: 12.5px; font-weight: 600; }
.ai-draft-btn svg { width: 13px; height: 13px; }
.ai-draft-btn:hover { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.ai-draft { display: flex; align-items: center; gap: 8px; margin: 8px 10px 0; padding: 4px 4px 4px 12px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.ai-draft > svg { width: 15px; height: 15px; color: var(--accent); }
.ai-draft input { flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 6px 0; }
.ai-draft .btn { height: 30px; }
/* ---------- Editing labels (⋮ on a label, + by the title) ---------- */
.side h3.with-action { display: flex; align-items: center; justify-content: space-between; margin-right: 4px; }
.side h3.with-action .icon-btn { width: 24px; height: 24px; border-radius: 7px; }
.side h3.with-action .icon-btn svg { width: 15px; height: 15px; }
.label-wrap { position: relative; }
.label-wrap .nav-item { padding-right: 34px; }
.label-more { position: absolute; right: 4px; top: 4px; width: 24px; height: 24px; border-radius: 7px; opacity: 0; }
.label-wrap:hover .label-more, .label-more.open { opacity: 1; }
.label-wrap:hover .nav-item .num { visibility: hidden; }
.label-menu { top: 30px; right: 0; width: 240px; }
.label-edit { position: absolute; z-index: 45; left: 6px; right: 0; margin-top: 4px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--pop); }
.label-edit input { width: 100%; height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; background: var(--surface); outline: none; }
.label-edit input:focus { border-color: var(--accent); }
.swatches { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 10px 0; }
.swatch { aspect-ratio: 1; border: 0; border-radius: 50%; padding: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.swatch.none { background: repeating-linear-gradient(135deg, var(--surface) 0 4px, var(--line) 4px 6px); }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.label-edit footer { display: flex; justify-content: flex-end; gap: 6px; }
/* ---------- Shared inboxes ---------- */
.nav-item.shared svg { color: var(--accent); }
.nav-item.sub { padding-left: 34px; height: 30px; font-size: 13px; }
.nav-item.faint { color: var(--faint); }
.list-note { margin: 0 18px 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.connect-shared { padding: 0 18px 8px; }
.connect-shared .inline-field input { flex: 1; min-width: 0; height: 36px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 0 10px; background: var(--surface); }
.connect-shared .inline-field { flex-wrap: nowrap; gap: 8px; }
.member-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 360px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.member-list li + li { border-top: 1px solid var(--line); }
.member-list .check { padding: 8px 12px; gap: 10px; cursor: pointer; }
.member-list .check span { display: grid; line-height: 1.3; }
.member-list .check b { font-weight: 550; }
.member-list .check small { color: var(--faint); font-size: 12px; }
.form-actions { display: flex; gap: 8px; justify-content: space-between; }
.btn.danger { color: var(--danger); }
.from-select { flex: 1; border: 0; background: none; padding: 10px 0; color: var(--fg); outline: none; }
/* ---------- Select all (⌘A) and bulk actions ---------- */
.row-check { position: absolute; left: 8px; top: 14px; width: 16px; height: 16px; border: 1.5px solid var(--line-strong); border-radius: 5px; background: var(--surface); display: none; place-items: center; color: transparent; z-index: 1; }
.row-check svg { width: 12px; height: 12px; stroke-width: 3; }
.rows:has(.row.picked) .row-check { display: grid; }
.rows:has(.row.picked) .row.unread::before { display: none; }
@media (hover: hover) { .row.unread:hover::before { display: none; } }
.row.picked { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.row.picked .row-check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.bulk-pane { height: 100%; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; }
.bulk-art { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); margin-bottom: 6px; }
.bulk-art svg { width: 30px; height: 30px; }
.bulk-pane h2 { margin: 0; font-size: 19px; font-weight: 600; }
.bulk-pane .links { display: flex; gap: 18px; margin: 0; }
.bulk-pane .link { font-size: 14px; }
.bulk-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 560px; margin-top: 8px; }
.bulk-actions .btn { height: 36px; padding: 0 14px; }
.bulk-actions .picker { left: 0; right: auto; }
/* ---------- Folding the sidebar away (Front's toggle) ---------- */
.rail-fold { margin-bottom: 2px; }
.rail-sep { width: 24px; height: 1px; background: var(--line-strong); margin: 6px 0; }
.rail-compose { background: var(--accent); color: var(--on-accent); }
.rail-compose:hover { background: var(--accent-strong); color: var(--on-accent); }
.app.folded .nav { grid-template-columns: 56px; }
.app.folded .side { display: none; }
@media (max-width: 1180px) {
  .rail-fold, .rail-sep { display: none; }
  .app.folded .nav { grid-template-columns: 56px 236px; }
  .app.folded .side { display: flex; }
}

/* Front's "•••": the quoted emails below a reply, folded until opened. */
.quote-fold { margin-top: 10px; }
.quote-fold > summary { display: inline-block; list-style: none; cursor: pointer; padding: 0 9px; border-radius: 8px; background: var(--surface-3); color: var(--muted); font: 700 12px/18px inherit; letter-spacing: 1px; }
.quote-fold > summary::-webkit-details-marker { display: none; }
.quote-fold > summary:hover { color: var(--fg); }
.quote-fold[open] > summary { margin-bottom: 10px; }

/* An open email's header folds it back on click (Front). */
.mail > header.foldable { cursor: pointer; }
.mail > header.foldable .who { justify-self: start; max-width: 100%; border-radius: 8px; transition: background .1s; }
.mail > header.foldable:hover .who { background: var(--surface-3); box-shadow: 0 0 0 6px var(--surface-3); }

/* Writing an email, as in Front: the text, Front's formatting bar (Aa), then one row of tools and the send button. */
.mail-editor .sig-editor { border: 0; border-radius: 0; box-shadow: none; background: none; }
.mail-editor .sig-canvas { border-radius: 0; background: transparent; color-scheme: normal; }
.modal.compose .mail-editor { border-top: 1px solid var(--line); margin-top: 6px; }
.modal.compose .forwarded { margin: 8px 14px 0; }
.compose-tools { border-top: 1px solid var(--line); padding: 8px 12px; gap: 6px; }
.compose-tools select { min-width: 124px; }
.compose-tools select.narrow { min-width: 62px; }
.compose-tools .color { width: 36px; }
.compose-tools .icon-btn { width: 32px; height: 32px; }
.compose-bar { display: flex; align-items: center; gap: 4px; padding: 8px 10px 10px 12px; border-top: 1px solid var(--line); }
.compose-bar .grow { flex: 1; }
.compose-bar .icon-btn { width: 34px; height: 34px; color: var(--muted); }
.compose-bar .icon-btn:hover { color: var(--fg); }
.compose-bar .icon-btn.on { color: var(--accent-strong); }
.compose-bar label.icon-btn { display: inline-grid; place-items: center; cursor: pointer; border-radius: 9px; }
.compose-bar label.icon-btn:hover { background: var(--hover); }
.compose-bar .emoji-wrap { position: relative; }
.mail-editor .sig-pick { padding: 2px 16px 8px; }
.out-files { list-style: none; margin: 0; padding: 4px 12px 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.out-files li { display: inline-flex; align-items: center; gap: 6px; max-width: 280px; height: 32px; padding: 0 4px 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2, var(--surface)); font-size: 13px; }
.out-files li > svg { width: 14px; height: 14px; color: var(--faint); flex: none; }
.out-files .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.out-files .s { color: var(--faint); font-size: 12px; flex: none; }
.out-files .icon-btn { width: 24px; height: 24px; }
.send-split { position: relative; display: inline-flex; margin-left: 6px; }
.send-split .btn.primary { height: 38px; padding: 0 16px; font-size: 14px; font-weight: 600; border-radius: 10px; }
.send-split .btn.primary:first-child:not(:last-of-type) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.send-split .btn.primary.more { padding: 0 10px; border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid color-mix(in srgb, var(--on-accent) 25%, transparent); }
.send-split .btn.primary.more svg { width: 16px; height: 16px; }
.send-menu { width: 220px; position: absolute; right: 0; top: auto; bottom: calc(100% + 6px); z-index: 30; display: grid; }

/* Settings › Gemini usage */
.banner.warn { background: color-mix(in srgb, #f59e0b 14%, var(--surface)); border-color: color-mix(in srgb, #f59e0b 45%, var(--line)); }
.banner.warn > svg { color: #d97706; }
.banner.warn span { color: var(--fg); }
.gem-today { margin: 4px 18px 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.gem-kpi { display: grid; gap: 2px; align-content: start; }
.gem-kpi span { font-size: 12px; color: var(--muted); }
.gem-kpi b { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.gem-kpi small { color: var(--faint); font-size: 12px; }
.gem-meter { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.gem-meter i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.gem-meter.near i { background: #f59e0b; }
.gem-meter.over i { background: #e5484d; }
.gem-paused { grid-column: 1 / -1; margin: 0; display: flex; gap: 6px; align-items: center; color: #c2410c; font-size: 12.5px; }
.gem-paused svg { width: 15px; height: 15px; flex: none; }
.gem-form { display: grid; gap: 14px; margin: 0 18px 18px; min-width: 0; }
.gem-form .form-field, .gem-prices > * { min-width: 0; }
.gem-form input[type=number], .gem-form .inline-field input { width: 100%; min-width: 0; box-sizing: border-box; }
.gem-form .inline-field { display: flex; gap: 8px; flex-wrap: nowrap; }
.gem-form .inline-field input:first-child { flex: 1; width: auto; }
.gem-form small { white-space: normal; }
.gem-form .inline-field input { min-width: 0; }
.gem-form .inline-field .cur { width: 70px; flex: none; text-transform: uppercase; }
.gem-prices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gem-form .btn.primary { justify-self: start; }
.gem-pane .pane-scroll { padding: 8px 24px 32px; }
.gem-table { width: 100%; max-width: 760px; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; margin-bottom: 18px; }
.gem-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--line); }
.gem-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); }
.gem-table tr.over td { color: #c2410c; }
.gem-table td.bar { position: relative; width: 30%; }
.gem-table td.bar i { display: block; height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 70%, transparent); min-width: 2px; }
.gem-table tr.over td.bar i { background: #e5484d; }
.gem-table td.bar b { position: absolute; top: 4px; bottom: 4px; width: 2px; background: var(--fg); opacity: .35; }

/* Settings › From Front */
.tabs { gap: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs a { white-space: nowrap; font-size: 13.5px; }
.front-pane .pane-scroll { padding: 12px 28px 40px; }
.front-steps { max-width: 640px; margin: 0; padding-left: 22px; display: grid; gap: 22px; }
.front-steps > li > b { font-size: 15px; }
.front-steps > li > p { margin: 6px 0 0; color: var(--muted); line-height: 1.55; }
.front-form { display: grid; gap: 14px; margin-top: 10px; max-width: 440px; }
.front-form input, .front-form select { height: 38px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 12px; background: var(--surface); color: var(--fg); }
.front-form input[type=number] { width: 90px; }
.front-form .btn { justify-self: start; }
.front-plan { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.front-plan > div { display: grid; gap: 2px; align-content: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.front-plan span { font-size: 12px; color: var(--muted); }
.front-plan b { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.front-plan small { font-size: 12px; color: var(--faint); }
.front-plan .go { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }
.front-missing { margin-top: 12px; color: var(--muted); font-size: 13px; }
.front-missing summary { cursor: pointer; }
.front-missing ul { margin: 6px 0 0; padding-left: 18px; }
.front-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
@media (max-width: 900px) { .front-plan { grid-template-columns: 1fr 1fr; } }
.front-form input.secret { -webkit-text-security: disc; text-security: disc; font-family: ui-monospace, Menlo, monospace; }
.front-form input.secret:placeholder-shown { font-family: inherit; }

/* Answer with Gemini: the writing window */
.modal.gem-writer { width: 680px; max-width: calc(100vw - 32px); display: flex; flex-direction: column; gap: 12px; padding: 0 0 14px; }
.gem-writer header { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0; }
.gem-writer header h2 { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; }
.gem-writer header h2 svg { width: 18px; height: 18px; color: var(--accent); }
.gem-writer header .to { flex: 1; color: var(--muted); font-size: 13px; }
.gem-intro { margin: 0 16px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.gem-draft { margin: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.gem-versions { display: flex; align-items: center; gap: 2px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.gem-versions span { flex: 1; }
.gem-versions .icon-btn { width: 28px; height: 28px; }
.gem-draft textarea { display: block; width: 100%; box-sizing: border-box; min-height: 220px; max-height: 50vh; border: 0; outline: none; resize: vertical; padding: 12px 14px; background: none; color: var(--fg); font: 14px/1.6 var(--font); }
.gem-ask { display: flex; gap: 8px; align-items: flex-end; margin: 0 16px; padding: 6px 6px 6px 12px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.gem-ask textarea { flex: 1; min-width: 0; border: 0; outline: none; resize: none; background: none; color: var(--fg); font: 14px/1.5 var(--font); padding: 6px 0; }
.gem-ask .btn { height: 34px; flex: none; }
.gem-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 16px; }
.gem-chips .chip { border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; padding: 4px 10px; cursor: pointer; color: var(--fg); }
.gem-chips .chip:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); color: var(--accent-strong); }
.gem-writer footer { display: flex; align-items: center; gap: 10px; padding: 2px 16px 0; }
.gem-writer footer .fine { flex: 1; }
.front-note { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.front-note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.front-note.ok svg { color: #16a34a; }

/* The signature in the email being written, as in Front: under the text; on hover, switch or remove it. */
.sig-inline { position: relative; margin: 0 12px 8px; padding: 10px 14px; border-radius: 10px; background: #fff; transition: background .1s; }
.sig-inline:hover, .sig-inline.open { background: #eef0f3; }
.sig-inline .fit-frame { pointer-events: none; display: block; }
/* The signature's white page takes the grey of the hover. */
.sig-inline:hover .fit-frame, .sig-inline.open .fit-frame { mix-blend-mode: multiply; }
.sig-actions { position: absolute; top: 8px; right: 8px; display: none; gap: 6px; }
.sig-inline:hover .sig-actions, .sig-inline.open .sig-actions { display: flex; }
.sig-actions .round { width: 26px; height: 26px; border-radius: 50%; border: 0; display: grid; place-items: center; background: #5f6670; color: #fff; cursor: pointer; }
.sig-actions .round:hover { background: #3f454d; }
.sig-actions .round svg { width: 14px; height: 14px; }
.sig-inline .sig-menu, .sig-add .sig-menu { right: 8px; left: auto; top: 40px; bottom: auto; width: 240px; }
.sig-add { position: relative; margin: 0 16px 8px; font-size: 12.5px; }
.sig-add .sig-menu { left: 0; right: auto; top: 22px; }
.sig-menu a { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 8px; border-radius: 8px; color: var(--fg); text-decoration: none; font-weight: 500; }
.sig-menu a:hover { background: var(--surface-3); }
.sig-menu a svg { width: 17px; height: 17px; color: var(--faint); }
.mail-editor .sig-editor { display: flex; flex-direction: column; }

/* Shared drafts, as in Front */
.draft-bar { position: relative; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2, var(--surface-3)); border-radius: 14px 14px 0 0; font-size: 13px; color: var(--muted); }
.draft-bar > svg { width: 16px; height: 16px; flex: none; }
.draft-bar b { color: var(--fg); font-weight: 600; margin-right: 4px; }
.draft-bar .grow { flex: 1; }
.draft-bar .link.accent { color: var(--accent-strong); font-weight: 600; }
.draft-bar.shared { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.draft-bar.shared > svg { color: var(--accent); }
.share-picker { position: absolute; z-index: 40; right: 8px; top: calc(100% + 6px); width: 340px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--pop); display: flex; flex-direction: column; color: var(--fg); }
.share-picker .to { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.share-picker .to > span:first-child { color: var(--muted); }
.share-picker .to input { flex: 1; min-width: 120px; border: 0; outline: none; background: none; color: var(--fg); font-size: 14px; padding: 4px 0; }
.share-picker .pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 13px; font-weight: 500; }
.share-picker .pill button { border: 0; background: none; color: inherit; display: grid; place-items: center; padding: 2px; cursor: pointer; }
.share-picker .pill svg { width: 12px; height: 12px; }
.share-picker .group { padding: 10px 14px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.share-picker ul { list-style: none; margin: 0; padding: 0 6px 6px; max-height: 240px; overflow-y: auto; }
.share-picker li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; cursor: pointer; font-size: 14px; }
.share-picker li[aria-selected="true"] { background: var(--surface-3); }
.share-picker li.none { color: var(--faint); cursor: default; }
.share-picker footer { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.draft-card { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 880px; margin: 0 auto 8px; padding: 10px 14px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); color: var(--muted); font-size: 13px; text-align: left; cursor: pointer; }
.draft-card:hover { border-style: solid; }
.draft-card > svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.draft-card > span:nth-child(2) { flex: 1; }
.draft-card b { color: var(--fg); }
.draft-card .open { color: var(--accent-strong); font-weight: 600; }
.send-note { padding: 0 8px; }

/* Composer fields at Front's size: "From:", "To:", "Subject:" and what's typed in them. */
.field > span { font-size: 15px; color: var(--muted); width: auto; min-width: 62px; }
.field > span::after { content: ":"; }
.field input { font-size: 15px; padding: 12px 0; }
.field .add-cc { font-size: 14.5px; }
.field.from { border-bottom: 0; padding-top: 8px; }
.field.from > .from-chip { flex: none; min-width: 0; width: auto; font-size: 15px; color: var(--fg); background: var(--accent-soft); border: 0; border-radius: 7px; padding: 4px 10px; }
.field.from > .from-chip::after { content: none; }
.field.from select.from-chip { cursor: pointer; outline: none; }

.field .add-cc + .add-cc { margin-left: 14px; }
.field.labels { padding-top: 6px; padding-bottom: 6px; }
.label-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.label-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: var(--fg); }
.label-chip button { border: 0; background: none; color: var(--muted); display: grid; place-items: center; padding: 2px; cursor: pointer; }
.label-chip svg { width: 12px; height: 12px; }
.compose-labels { position: relative; }
.compose-labels .picker { right: auto; left: 12px; top: auto; bottom: 64px; }

/* On a phone, the composer's tool row keeps what's used most (templates come with "/", tags with T). */
@media (max-width: 760px) {
  .compose-bar { gap: 0; padding-left: 6px; }
  .compose-bar .icon-btn { width: 34px; }
  .compose-bar .opt, .compose-bar .track { display: none; }
  .send-split .btn.primary { padding: 0 12px; }
  .draft-bar > span:not(.grow) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
}

/* The email list at Front's size. */
.row .from { font-size: 15px; }
.row .subj { font-size: 14.5px; }
.row .snip { font-size: 14px; }
.row time { font-size: 12.5px; }
.row .from .n { font-size: 12.5px; }

/* Recipients as chips, as in Front. */
.field.recip { align-items: flex-start; }
.field.recip > span { padding-top: 12px; }
.recips { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 7px 0; }
.recips input { flex: 1; min-width: 40px; padding: 5px 0; }
.recip-chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 3px 3px 3px 10px; border-radius: 7px; background: var(--surface-3); font-size: 14.5px; color: var(--fg); }
.recip-chip button { border: 0; background: none; color: var(--faint); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; cursor: pointer; opacity: 0; }
.recip-chip:hover button { opacity: 1; }
.recip-chip button:hover { background: var(--hover); color: var(--fg); }
.recip-chip svg { width: 12px; height: 12px; }
.field.recip > .add-cc { margin-top: 12px; }
.reply-form > .field.from { border-bottom: 0; }

/* Reply or reply all, in the draft's header. */
.reply-mode { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--surface-3); margin-left: 6px; }
.reply-mode button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 3px 9px; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: var(--muted); cursor: pointer; }
.reply-mode button svg { width: 14px; height: 14px; }
.reply-mode button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.draft-bar .icon-btn { width: 28px; height: 28px; margin-left: 2px; }
@media (max-width: 760px) { .reply-mode button { padding: 3px 7px; } .reply-mode button svg { display: none; } .draft-bar > span:not(.grow):not(.reply-mode) { display: none; } }
.from-chip { display: inline-flex; align-items: center; margin: 7px 0; padding: 3px 10px; border-radius: 7px; background: var(--surface-3); font-size: 14.5px; color: var(--fg); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Phone layout: floating pills within thumb's reach ---------- */
.phone-top, .tabbar, .sheet-head, .chips-assign, .mail-menu { display: none; }
.float-pill { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--raised); color: var(--fg); font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; }
.float-pill.round { width: 46px; padding: 0; justify-content: center; flex: none; }
.float-pill svg { width: 20px; height: 20px; }
.float-pill:disabled { opacity: .45; }
@media (max-width: 760px) {
  /* The list: where you are and search on top, the modes and a new email at the bottom. */
  .list-top { display: none; }
  .phone-top { display: flex; align-items: center; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 14px 4px; }
  .phone-top .place > svg:last-child { width: 14px; height: 14px; color: var(--faint); }
  .list { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; align-items: center; gap: 10px; position: fixed; left: 14px; right: 14px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30; }
  .tabbar .tabs { flex: 1; height: 60px; padding: 5px; gap: 2px; justify-content: space-between; }
  .tabbar .tabs a { position: relative; flex: 1; height: 48px; display: grid; place-items: center; border-radius: 999px; color: var(--muted); }
  .tabbar .tabs a[aria-current="page"] { background: var(--surface-3); color: var(--fg); }
  .tabbar .tabs svg { width: 22px; height: 22px; }
  .tabbar .rail-badge { top: 5px; right: calc(50% - 22px); box-shadow: 0 0 0 2px var(--surface); }
  .tabbar .compose-fab { width: 60px; height: 60px; }
  .tabbar .compose-fab svg { width: 24px; height: 24px; }
  .app.drawer .tabbar { display: none; }

  /* An open conversation: back on the left, snooze · archive · more in a pill, the subject in large below. */
  .pane-top { background: none; border-bottom: 0; padding: max(10px, env(safe-area-inset-top)) 14px 6px; }
  .pane-top .toolbar { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "back . tools" "title title title"; row-gap: 14px; }
  .pane-top .back { grid-area: back; width: 46px; height: 46px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--raised); }
  .pane-top .back svg { width: 20px; height: 20px; }
  .pane-top .pane-title { grid-area: title; white-space: normal; font-size: 22px; line-height: 1.25; margin: 0 4px; min-width: 0; }
  .pane-top .tool-group { grid-area: tools; height: 46px; padding: 0 6px; gap: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--raised); }
  .pane-top .tool-group .icon-btn { width: 40px; height: 40px; border-radius: 999px; }
  .pane-top .tool-group .icon-btn svg { width: 20px; height: 20px; }
  .pane-top .more-wrap { order: 3; }
  .pane-top .top-assign { display: none; }
  .pane-top .archive-btn { order: 2; width: 40px; height: 40px; padding: 0; justify-content: center; border: 0; background: none; box-shadow: none; border-radius: 999px; }
  .pane-top .archive-btn svg { width: 20px; height: 20px; }
  .pane-top .archive-btn span { display: none; }
  .pane-sub { margin-top: 12px; padding: 8px; gap: 8px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 14px; }
  .pane-sub .chips-assign { display: inline-flex; }
  .pane-sub .people-chip, .pane-sub .label-chip { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
  .pane-sub .add-label { width: 34px; height: 34px; border-radius: 10px; }
  .pane-sub .sep { display: none; }
  .pane-sub a.meta { display: none; }

  /* Each email's actions in one ⋮ menu. */
  .mail .mail-actions { display: none; }
  .mail .mail-menu { display: inline-flex; }
  .mail .mail-menu .picker { right: 0; left: auto; top: calc(100% + 4px); min-width: 220px; }
  .mail { border-radius: 18px; }

  /* The comment bar floats at the bottom as a pill until it's used. */
  .dock { padding: 8px 14px calc(12px + env(safe-area-inset-bottom)); }
  .dock .comment-bar:not(:focus-within):not(.typing):not(.expanded) { border-radius: 26px; box-shadow: var(--raised); min-height: 52px; align-items: center; }

  /* Replying takes the whole screen: close, subject and send at the top; the tools at the bottom. */
  .dock.replying .reply-form { position: fixed; inset: 0; z-index: 45; height: var(--vvh, 100dvh); max-width: none; margin: 0; border: 0; border-radius: 0; box-shadow: none;
    display: flex; flex-direction: column; overflow-y: auto; padding-top: env(safe-area-inset-top); }
  .reply-form .sheet-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; flex: none; }
  .reply-form .sheet-head b { flex: 1; min-width: 0; text-align: center; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .reply-form .sheet-head .send-now { color: var(--accent-strong); }
  .reply-form .draft-bar { border-radius: 0; flex: none; }
  .reply-form .draft-bar .icon-btn[aria-label="Close"] { display: none; }
  .reply-form > .field { flex: none; }
  .reply-form .mail-editor { flex: 1; display: flex; flex-direction: column; min-height: 0; }
  .reply-form .mail-editor .sig-editor { flex: 1; }
  .reply-form .sig-canvas { flex: 1; min-height: 160px; }
  .reply-form .compose-bar { margin-top: auto; position: sticky; bottom: 0; margin: 0 10px calc(10px + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: var(--raised); padding: 6px 6px 6px 10px; }
}

/* Assistant feedback: "Move" under an email, to the right group; and what it learned. */
.row .why-line { gap: 8px; }
.row .why-line .why { flex: 1; min-width: 0; }
.move-wrap { position: relative; flex: none; }
.move-btn { border: 0; background: none; padding: 1px 6px; border-radius: 6px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--accent-strong); cursor: pointer; visibility: hidden; }
.move-btn:hover, .move-btn[aria-expanded="true"] { background: var(--accent-soft); }
.row:focus-within .move-btn, .move-btn[aria-expanded="true"] { visibility: visible; }
@media (hover: hover) { .row:hover .move-btn { visibility: visible; } }
@media (hover: none) { .move-btn { visibility: visible; } }
.move-menu { position: absolute; right: 0; top: calc(100% + 4px); left: auto; z-index: 20; min-width: 240px; }
.move-menu .menu-head { padding: 6px 10px 4px; font-size: 12px; font-weight: 600; color: var(--faint); }
.move-menu button[aria-checked="true"] { color: var(--accent-strong); }
.move-menu button > svg:last-child { margin-left: auto; }
.move-menu .fine { margin: 4px 10px 6px; font-size: 12px; white-space: normal; }
.learned { display: grid; gap: 6px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.learned > small { color: var(--muted); }
.learned ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; }
.learned li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2, var(--surface-3)); }
.learned li > div { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.learned .sender { font-weight: 550; overflow-wrap: anywhere; }
.learned .arrow { color: var(--faint); }
.learned li small { flex-basis: 100%; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* On a phone, typing happens at 16px or more: iPhone Safari zooms in on smaller fields when they're tapped, which
   pushes the screen's right edge (send, reply all) out of view. */
@media (max-width: 760px) {
  input, textarea, select, [contenteditable="true"], .editor { font-size: 16px !important; }
}

/* Pull to refresh (phones): an arrow that follows the finger at the top of the list, and spins while it reloads. */
.list-col { position: relative; }
.ptr { position: absolute; left: 50%; top: 56px; z-index: 5; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--raised); color: var(--muted); opacity: 0; pointer-events: none;
  transform: translate(-50%, -44px); }
.ptr svg { width: 18px; height: 18px; }
.ptr.ready { color: var(--accent-strong); }
.ptr.spin svg { animation: ptr-spin .8s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
@media (pointer: fine) { .ptr { display: none; } }
.learned .resort { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 6px; }
.learned .resort small { flex: 1; min-width: 200px; color: var(--faint); }

/* Sharing: who's on the conversation, with × for those added. */
.picker .members { border-bottom: 1px solid var(--line); margin-bottom: 4px; padding-bottom: 4px; }
.picker .members .head { font-size: 12px; font-weight: 600; color: var(--faint); padding: 6px 10px 2px; cursor: default; background: none; }
.picker .members .member { cursor: default; }
.picker .members .member:hover { background: none; }
.picker .members .icon-btn { margin-left: auto; width: 28px; height: 28px; }
.picker .members .tag { margin-left: auto; }

/* Settings › Forwarding, and the dialog from an email. */
.forwarding-form { margin: 0 18px 8px; }
.forward-rules { list-style: none; margin: 0 12px; padding: 0; display: grid; gap: 4px; }
.forward-rules li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.forward-rules li > div { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; overflow-wrap: anywhere; }
.forward-rules .arrow { color: var(--faint); }
.forward-rules small { flex-basis: 100%; color: var(--faint); }
.forward-dialog .forward-body { display: grid; gap: 14px; padding: 4px 18px 8px; }
.forward-dialog footer { display: flex; gap: 8px; }

/* A long reply (signature, formatting bar) never pushes Send out of reach: the reply scrolls on its own, a part of the
   conversation stays in view above it, and the bar with Send stays pinned at its bottom. */
@media (min-width: 761px) {
  .pane-scroll { min-height: 140px; }
  .dock.replying { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .dock.replying .reply-form .compose-bar { position: sticky; bottom: 0; z-index: 3; background: var(--surface); border-radius: 0 0 14px 14px; }
  .dock.replying .reply-form .compose-tools { position: sticky; bottom: 52px; z-index: 3; background: var(--surface); }
}
@media (min-width: 761px) {
  /* The text scrolls inside its box when the reply is long, so the whole reply (and Send) fits on screen. */
  .dock.replying .reply-form .sig-canvas { max-height: max(150px, calc(100vh - 480px)); }
}
.learned .kind { font-size: 12px; color: var(--muted); background: var(--surface-3); border-radius: 6px; padding: 0 6px; }
/* A conversation with your unsent reply in it (a Gmail draft), as in Gmail. */
.row .draft-mark { color: #d93025; font-weight: 600; margin-right: 6px; }
@media (prefers-color-scheme: dark) { .row .draft-mark { color: #f28b82; } }
.row .where-mark { font-size: 11px; font-weight: 600; color: var(--muted, #6b6f76); border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-right: 4px; }
.forward-files { display: flex; align-items: center; gap: 6px; margin: 0 16px 8px; font-size: 13px; color: var(--muted); }
.forward-files svg { width: 14px; height: 14px; flex: none; }
/* Forwarding, on an open email. */
.forwarding-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 auto 12px; max-width: 880px; padding: 9px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.forwarding-bar svg { width: 16px; height: 16px; flex: none; color: var(--accent); }
.forwarding-bar b { color: var(--fg); font-weight: 600; }
.forwarding-bar.done { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.forwarding-bar .link { margin-left: auto; }
.learned.rules .sub { margin-top: 10px; }

/* Swiping a row on a phone: the row moves over a panel saying what letting go does. */
.rows { position: relative; }
.row { touch-action: pan-y; }
.row.swiping { z-index: 1; background: var(--list); }
.swipe-under { position: absolute; left: 8px; right: 8px; border-radius: 10px; display: none; align-items: center; padding: 0 22px; color: #fff; font-weight: 650; font-size: 15px; pointer-events: none; }
.swipe-under.on { display: flex; }
.swipe-under[data-kind="archive"] { justify-content: flex-end; background: #2f9e5b; }
.swipe-under[data-kind="trash"] { justify-content: flex-start; background: #d9534f; }
.swipe-under .swipe-label { opacity: .75; transform: scale(.92); transition: transform 120ms, opacity 120ms; }
.swipe-under.ready .swipe-label { opacity: 1; transform: scale(1.06); }

/* Sent: whether your latest email was opened (Front's "Seen"). */
.row .seen-mark { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 550; color: var(--faint); white-space: nowrap; }
.row .seen-mark.yes { color: var(--accent-strong); }
.row .seen-mark svg { width: 13px; height: 13px; }

/* On a phone, full-screen sheets (a reply, a new email) cover what's visible above the keyboard, where it is (iPhone
   Safari scrolls the page when the keyboard opens), and their Send bar stays at the bottom of it. */
@media (max-width: 760px) {
  .modal-back, .dock.replying .reply-form { top: var(--vvt, 0px); bottom: auto; height: var(--vvh, 100dvh); }
  .modal.compose { overflow-y: auto; overscroll-behavior: contain; }
  .modal.compose .compose-bar { position: sticky; bottom: 0; z-index: 3; background: var(--surface); }
}
/* Keyboard shortcuts mean nothing on a touch screen. */
@media (hover: none) and (pointer: coarse) { .picker.menu kbd, .menu kbd { display: none; } }
/* On a phone, the pickers under the subject (label, assign, share) open across the screen near its top, above the
   keyboard their search box brings up, instead of off its edge. */
@media (max-width: 760px) {
  .pane-sub .picker { position: fixed; left: 12px; right: 12px; top: calc(var(--vvt, 0px) + 72px); bottom: auto; width: auto; min-width: 0; max-width: none;
    max-height: calc(var(--vvh, 100dvh) - 96px); overflow-y: auto; z-index: 60; }
}

/* A calendar invitation in an email (as in Front): the event, your day around it, Yes / Maybe / No. */
.invite { margin: 4px 0 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.invite header { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px 6px; }
.invite .inv-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #e53935; color: #fff; }
.invite .inv-icon svg { width: 20px; height: 20px; }
.invite.cancelled .inv-icon { background: var(--faint); }
.invite .inv-title { font-size: 15.5px; display: block; }
.invite .inv-when { color: var(--muted); margin-top: 2px; }
.invite .inv-tag { display: inline-block; margin-left: 8px; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface-3); border-radius: 6px; padding: 1px 6px; vertical-align: 1px; }
.invite .inv-row { display: flex; gap: 10px; align-items: flex-start; padding: 6px 16px; color: var(--fg); }
.invite .inv-row > svg { flex: none; width: 17px; height: 17px; margin-top: 2px; color: var(--faint); }
.invite .inv-row a { color: var(--accent-strong); font-weight: 550; text-decoration: none; }
.invite .inv-guests { display: flex; flex-wrap: wrap; gap: 6px; }
.invite .inv-guest { display: inline-flex; align-items: center; gap: 5px; background: var(--surface-3); border-radius: 7px; padding: 2px 8px; font-size: 13px; }
.invite .inv-guest svg { width: 12px; height: 12px; }
.invite .inv-guest.accepted svg { color: #2f9e5b; }
.invite .inv-guest.declined { color: var(--faint); text-decoration: line-through; }
.invite .inv-org { font-size: 11px; font-weight: 650; color: var(--accent-strong); }
.invite .inv-day { margin: 8px 16px 4px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 8px; }
.invite .inv-hours { position: relative; height: 150px; margin-left: 46px; }
.invite .inv-hour { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.invite .inv-hour span { position: absolute; left: -46px; top: -8px; font-size: 11.5px; color: var(--faint); }
.invite .inv-block { position: absolute; left: 4px; right: 4px; border-radius: 7px; padding: 3px 8px; font-size: 12.5px; overflow: hidden; display: flex; gap: 8px; align-items: baseline; min-height: 18px; }
.invite .inv-block.this { background: var(--accent-soft); border: 1.5px solid var(--accent); color: var(--accent-strong); z-index: 1; }
.invite .inv-block.this.clash { left: 40%; }
.invite .inv-block.other { background: var(--surface-3); color: var(--muted); right: 62%; }
.invite .inv-zone { font-size: 11.5px; color: var(--faint); margin-top: 6px; }
.invite .inv-clash { color: #c2410c; }
.invite .inv-answer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px 14px; border-top: 1px solid var(--line); margin-top: 10px; }
.invite .inv-q { color: var(--muted); }
.invite .inv-buttons { margin-left: auto; display: flex; gap: 6px; }
.invite .inv-buttons .btn { min-width: 64px; justify-content: center; }
.invite .inv-buttons .btn.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.invite .inv-note { flex-basis: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; background: var(--surface); color: var(--fg); resize: vertical; }
.invite .inv-how { flex-basis: 100%; margin: 0; }
.invite .inv-how a { color: var(--accent-strong); }
@media (max-width: 760px) { .invite .inv-buttons { margin-left: 0; flex-basis: 100%; } .invite .inv-buttons .btn { flex: 1; } .invite .inv-note { font-size: 16px; } }
.invite .inv-block b, .invite .inv-block span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .invite .inv-block.this span { display: none; } }
