/* LVA Inbox, round 2: misty sage glass, matched to the owner's 7 reference screenshots.
   Behind every page: a slow moving mesh gradient (bg.js, WebGL) over a CSS copy of the same gradient (.bg, the
   fallback), plus a faint grain tile. Cards are real glass (backdrop blur + saturate, only while in view), chips
   are solid white pills, the dock / icon buttons are glass. Type: Inter, self-hosted.
   Legibility: white text only on the deeper sage zones or on a dark glass tag; dark text on pale glass. */

@font-face { font-family: "Inter"; src: url("fonts/inter-var.woff2") format("woff2"); font-weight: 100 900;
  font-style: normal; font-display: swap; }

/* ---------- tokens (hex values sampled with PIL from the references; see the round 2 report) ---------- */
:root {
  /* background: sage top, white-green mist in the middle, forest only at the edges and the bottom */
  --bg-top: #6a7f6f;        /* refs: #728774 / #6e8470 (a touch deeper so white text holds AA) */
  --bg-mist: #96a69a;       /* refs: #95a397 / #a3afa5 */
  --bg-bloom: #ccd9cf;      /* the brightest bloom, refs: up to #c9d6cc around the cards */
  --bg-low: #3f5848;        /* refs: #3f5b4a / #385145 */
  --bg-deep: #2a3c32;       /* refs: #304139 bottom, #2b3f34 edges */
  /* glass */
  --glass-hi: rgba(246, 252, 248, .76);   /* ref card top #e4e9e6 over the mist */
  --glass-lo: rgba(236, 246, 239, .6);   /* ref card body #e3ece5 to #c0c9c5 */
  --glass-solid-hi: rgba(236, 242, 238, .93); --glass-solid-lo: rgba(214, 225, 218, .9);   /* no-blur fallback */
  --rim-top: rgba(255, 255, 255, .9); --rim-bot: rgba(255, 255, 255, .18);
  --chip: #f6f9f8;          /* ref chip white */
  --ink: #17211b;           /* ref quote ink #1b201d / #172119 */
  --ink-2: #2b3a31;         /* ref date ink #737e77 is too light for AA; deepened, same hue */
  --on-bg: #ffffff;         /* ref headline #fefbfc */
  --tag: rgba(28, 46, 36, .58);   /* dark glass under small white text */
  --red: #8f2a1f; --red-bg: rgba(255, 236, 231, .94);
  --amber: #6e4600; --amber-bg: rgba(255, 244, 218, .94);
  --gold: #b8892a;
  --warm: #c4623a;         /* terracotta: the alert dot */
  --radius: 30px; --radius-row: 26px;
  --shadow: 0 22px 44px -20px rgba(14, 30, 21, .55), 0 2px 8px rgba(14, 30, 21, .08);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --spring-press: linear(0.0, 0.075, 0.252, 0.467, 0.677, 0.855, 0.987, 1.072, 1.115, 1.126, 1.116, 1.093, 1.066, 1.039, 1.017, 1.001, 0.991, 0.985, 0.984, 0.986, 0.988, 0.992, 0.995, 0.998, 1.0, 1.001, 1.002, 1.002, 1);
  --spring-soft: linear(0.0, 0.053, 0.174, 0.32, 0.467, 0.6, 0.712, 0.802, 0.871, 0.922, 0.958, 0.982, 0.997, 1.005, 1.01, 1.011, 1.011, 1.01, 1.008, 1.006, 1.005, 1.004, 1.002, 1.002, 1.001, 1.001, 1.0, 1.0, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --dock-h: 72px;           /* .dock-pill: 58 px buttons + 2 x 7 px padding */
  --dock-space: calc(var(--safe-b) + 14px + var(--dock-h) + 40px);   /* dock offset + dock + breathing room */
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* a class's display: flex must never show a hidden element */
html { -webkit-text-size-adjust: 100%; background: var(--bg-low); }
html, body { overflow-x: clip; }   /* belt and braces: glows and scrims never widen the page */
body { margin: 0; color: var(--on-bg); min-height: 100vh; background: transparent;
  font: 400 16px/1.45 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.011em;
  font-feature-settings: "cv11", "ss03"; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
main { padding: 0 16px var(--dock-space); max-width: 720px; margin: 0 auto; }
body.has-dock { scroll-padding-bottom: var(--dock-space); }
html:has(body.has-dock) { scroll-padding-bottom: var(--dock-space); }   /* focus / jumps never land under the dock */
body:not(.has-dock) main { padding-bottom: calc(var(--safe-b) + 24px); }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { flex: none; display: block; }

/* ---------- background: CSS gradient (fallback + first paint), WebGL canvas above it, grain on top ---------- */
.bg, .bg-gl, .grain { position: fixed; inset: 0; z-index: -3; pointer-events: none; width: 100%; height: 100%; }
.bg { overflow: hidden;
  background:
    radial-gradient(60% 34% at 64% 42%, rgba(204, 217, 207, .85), transparent 70%),
    radial-gradient(44% 26% at 24% 58%, rgba(184, 200, 188, .7), transparent 72%),
    radial-gradient(40% 30% at 8% 12%, rgba(74, 97, 81, .55), transparent 70%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mist) 38%, #8a9b8e 56%, var(--bg-low) 82%, var(--bg-deep) 100%); }
.bg::before, .bg::after { content: ""; position: absolute; width: 90vmax; height: 90vmax; border-radius: 50%; }
.bg::before { left: 20%; top: 18%; background: radial-gradient(closest-side, rgba(214, 226, 217, .55), transparent); }
.bg::after { left: -40%; top: 50%; background: radial-gradient(closest-side, rgba(52, 74, 60, .45), transparent); }
html:not(.gl):not(.still) .bg::before { animation: drift-a 78s ease-in-out infinite alternate; }
html:not(.gl):not(.still) .bg::after { animation: drift-b 64s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate3d(-22%, 14%, 0) scale(1.15); } }
@keyframes drift-b { to { transform: translate3d(26%, -12%, 0) scale(.9); } }
.bg-gl { z-index: -2; opacity: 0; transition: opacity .8s ease; }
html.gl .bg-gl { opacity: 1; }
.grain { z-index: -1; background: url("noise.png") repeat; background-size: 160px; opacity: .045; mix-blend-mode: overlay; }

/* ---------- glass: the shared material ---------- */
.row, .pane, .reply, .card, .login-card, .unpause, .msg.in, .msg.out, .sheet-body {
  position: relative; color: var(--ink);
  background:
    radial-gradient(120% 70% at 18% 0%, rgba(255, 255, 255, .38), transparent 62%),
    linear-gradient(172deg, var(--glass-solid-hi), var(--glass-solid-lo));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), var(--shadow); }
/* in view: the real thing, translucent so the gradient's colour comes through */
.row.blur, .pane.blur, .reply.blur, .card.blur, .login-card.blur, .unpause.blur, .msg.in.blur, .msg.out.blur, .sheet-body {
  background:
    radial-gradient(60% 60% at 30% 32%, rgba(255, 255, 255, .42), transparent 70%),
    linear-gradient(135deg, rgba(255, 255, 255, .80) 0%, rgba(247, 253, 249, .62) 42%, rgba(228, 241, 233, .46) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(180%) brightness(1.06); backdrop-filter: blur(22px) saturate(180%) brightness(1.06); }
/* the specular sweep: one soft diagonal highlight that slides a few px with scroll and tilt (motion.js sets --sx on
   the cards in view only, so nothing else restyles) */
.row.blur::before, .pane.blur::before, .reply.blur::before, .login-card.blur::before, .msg.in.blur::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; overflow: hidden;
  background: linear-gradient(115deg, transparent 18%, rgba(255, 255, 255, .34) 30%, rgba(255, 255, 255, 0) 44%);
  background-size: 200% 100%; background-position: calc(60% + var(--sx, 0px)) 0; mix-blend-mode: soft-light; }
/* the 1 px rim: bright on top where the light catches it, fading down the sides */
.row::after, .pane::after, .reply::after, .card::after, .login-card::after, .unpause::after, .msg.in::after, .msg.out::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(180deg, var(--rim-top), var(--rim-bot) 45%, rgba(255, 255, 255, .32));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; }
/* the stacked lip behind hero cards: two thinner cards peeking out above, as in the reference. Drawn as outer
   shadows (shrunk and lifted), which are never painted under the translucent card itself. */
.stack, .rows > li:first-child > .row:not(.deep) {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 -16px 0 -9px rgba(236, 244, 239, .34),
    0 -30px 0 -19px rgba(236, 244, 239, .2), var(--shadow); }
.rows > li:first-child > .row { margin-top: 12px; }
.rows > li:first-child > .row.lead.money { box-shadow: inset 0 0 0 2px var(--gold), 0 0 0 4px rgba(212, 170, 80, .22),
  0 -16px 0 -9px rgba(236, 244, 239, .34), 0 -30px 0 -19px rgba(236, 244, 239, .2), var(--shadow); }

/* ---------- buttons, chips ---------- */
button { font: inherit; letter-spacing: inherit; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 0;
  background: var(--chip); color: var(--ink); cursor: pointer; font-weight: 500;
  box-shadow: inset 0 1px 0 #fff, 0 6px 16px -6px rgba(14, 30, 21, .35); }
button[disabled] { opacity: .5; }
button.primary { background: linear-gradient(180deg, #4f6a58, #34493c); color: #fff; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 10px 22px -10px rgba(14, 30, 21, .7); }
button.danger { color: var(--red); }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--chip); color: var(--ink); border-radius: 999px;
  padding: 4px 12px; font-size: 13px; line-height: 1.35; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-weight: 500; box-shadow: 0 1px 2px rgba(14, 30, 21, .1); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.badge { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .78); color: var(--ink-2);
  overflow-wrap: anywhere; font-weight: 500; }
/* alerts stay inside the palette: a white pill, dark text and a small warm dot. Strong colour is kept for the one
   thing that must stop you (opted out / do not pitch). */
.badge.red, .badge.amber { background: #fff; color: var(--ink); display: inline-flex; align-items: center; gap: 7px; }
.badge.red::before, .badge.amber::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.badge.red::before { background: var(--warm); box-shadow: 0 0 0 3px rgba(196, 98, 58, .18); }
.badge.amber::before { background: #d39a3a; box-shadow: 0 0 0 3px rgba(211, 154, 58, .18); }

/* ---------- header ---------- */
.top { padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 4px; max-width: 720px; margin: 0 auto; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; letter-spacing: 0;
  color: var(--on-bg); }
.brand::before { content: "LV"; width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; font-size: 14px; font-weight: 600; letter-spacing: .02em; color: var(--ink);
  background: radial-gradient(circle at 35% 30%, #fff, #dfe8e2); box-shadow: 0 0 0 3px rgba(255, 255, 255, .35), 0 6px 16px -6px rgba(14, 30, 21, .5); }
/* round glass icon buttons */
.roundbtn, .back, .dock-pill, .dock-more summary, .poll, .statechip, .crm-age, .tag {
  -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%); }
.roundbtn, .back { width: 48px; height: 48px; flex: none; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; color: #fff; text-decoration: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .14));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 0 0 1px rgba(255, 255, 255, .22), 0 8px 18px -8px rgba(14, 30, 21, .5); }
.poll { font-size: 13px; font-weight: 500; color: var(--on-bg); background: var(--tag); border-radius: 999px; padding: 5px 12px;
  white-space: nowrap; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); }
.poll.ok::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #a6efbd;
  margin-right: 7px; vertical-align: 1px; box-shadow: 0 0 8px #a6efbd; }
.poll.amber::before, .poll.red::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 7px; vertical-align: 1px; }
.poll.amber::before { background: #e3b25a; }
.poll.red::before { background: #e07a52; box-shadow: 0 0 8px #e07a52; }
.statechip, .crm-age { display: inline-flex; align-items: center; gap: 8px; margin: 8px 0 2px; padding: 7px 14px 7px 11px;
  border-radius: 999px; font-size: 14px; line-height: 1.3; color: var(--on-bg); background: var(--tag);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 6px 16px -10px rgba(14, 30, 21, .6); }
.statechip.paused { background: rgba(112, 38, 24, .62); }


/* ---------- hero: big light white type on the sage, with a soft local shade so it always reads ---------- */
.hero, .login-hero { position: relative; padding: 10px 4px 12px; }
.hero::before, .login-hero::before { content: ""; position: absolute; inset: -30px -16px -10px -16px; z-index: -1; pointer-events: none;
  background: radial-gradient(64% 72% at 32% 55%, rgba(38, 60, 46, .42), transparent 78%); }
.hero .eyebrow, .login-hero p { font-size: 15px; font-weight: 500; color: var(--on-bg); margin: 0; width: fit-content; }
.hero h1, .login-hero h1 { font-size: 40px; line-height: 1.06; font-weight: 400; letter-spacing: -.035em; margin: 4px 0 0;
  color: var(--on-bg); overflow-wrap: anywhere; text-wrap: balance; }
.hero .sub { margin: 6px 0 0; color: var(--on-bg); font-size: 15px; overflow-wrap: anywhere; }

/* section labels: white type on a dark glass tag (the gradient behind them changes as you scroll) */
h2 { font-size: 15px; font-weight: 500; color: var(--on-bg); margin: 28px 0 14px; letter-spacing: -.005em; }
#list h2, .lead-sec h2, .sent-h { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  background: var(--tag); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 8px 20px -12px rgba(14, 30, 21, .7);
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); }
h2 .n { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: rgba(255, 255, 255, .92);
  color: var(--ink); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.empty { color: var(--on-bg); margin: 4px 4px; display: inline-block; padding: 6px 14px; border-radius: 999px; background: rgba(28, 46, 36, .66); font-size: 15px; }

/* ---------- list rows ---------- */
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.row-wrap { display: flex; gap: 8px; align-items: stretch; }
.row { flex: 1; min-width: 0; display: block; border-radius: var(--radius-row); padding: 16px 18px; text-decoration: none; min-height: 44px; }
.row-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.who { font-weight: 600; font-size: 17px; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.age { color: var(--ink-2); font-size: 13px; flex: none; padding-top: 3px; font-variant-numeric: tabular-nums; }
.row-sub { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; margin-top: 4px; }
.dom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
.preview { margin-top: 8px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.undo button { height: 100%; }
.done-list { margin-top: 6px; }
.done-list summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.done-list summary::-webkit-details-marker { display: none; }
.done-list summary h2 { margin-top: 20px; margin-bottom: 12px; }
.done-list summary h2::after { content: ""; width: 7px; height: 7px; border-right: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg); margin: 0 2px 0 2px; transition: transform .3s var(--ease-out); }
.done-list[open] summary h2::after { transform: rotate(45deg) translate(-2px, -2px); }
.need-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #2f7a4c; margin-right: 7px;
  vertical-align: 2px; box-shadow: 0 0 0 3px rgba(47, 122, 76, .18); }

/* ---------- thread ---------- */
.thread-top { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 8px; width: 100%; }
.thread-top .tt { position: relative; text-align: center; min-width: 0; }
.thread-top .tt::before { content: ""; position: absolute; inset: -12px -10px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(38, 60, 46, .4), transparent); }
.thread-top .tt b { display: block; width: fit-content; max-width: 100%; margin: 0 auto; font-weight: 500; font-size: 17px; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-top .tt span { display: block; width: fit-content; max-width: 100%; margin: 0 auto; font-size: 13px; font-weight: 500; color: var(--on-bg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.thread .top-row .poll { display: none; }
.thead { border-radius: var(--radius-row); padding: 14px 18px 6px; margin-top: 6px; }
.thead .row-sub { color: var(--ink); margin-top: 8px; }
.thead .row-sub .chip { background: #fff; }
.addr { color: var(--ink-2); font-size: 14px; word-break: break-all; }
.status { font-size: 14px; color: var(--ink); }
.status.needs_reply { font-weight: 600; }
.ext { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 15px; color: var(--ink); font-weight: 500; }
.daysep { list-style: none; align-self: center; font-size: 13px; font-weight: 500; color: var(--on-bg); background: var(--tag);
  padding: 4px 12px; border-radius: 999px; margin: 8px 0 0; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.chat { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; border-radius: 24px; padding: 12px 15px; }
.msg.in { align-self: flex-start; border-bottom-left-radius: 8px; }
.msg.out { align-self: flex-end; border-bottom-right-radius: 8px; }
.msg.out.blur { background: radial-gradient(120% 70% at 18% 0%, rgba(255, 255, 255, .26), transparent 62%),
  linear-gradient(172deg, rgba(232, 244, 236, .62), rgba(214, 232, 220, .5)); }
.msg.newest { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 0 0 2px rgba(255, 255, 255, .9), var(--shadow); }
.msg.step { align-self: center; max-width: 100%; width: 100%; background: var(--tag); color: var(--on-bg); border-radius: 22px;
  font-size: 14px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.msg.step summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.meta { font-size: 13px; color: var(--ink-2); margin-bottom: 4px; overflow-wrap: anywhere; }
.body { white-space: pre-wrap; overflow-wrap: anywhere; }
.whole summary { font-size: 14px; color: var(--ink-2); text-decoration: underline; min-height: 44px; display: flex;
  align-items: center; cursor: pointer; }
.sig summary { font-size: 14px; color: var(--ink-2); text-decoration: underline; min-height: 44px; display: flex;
  align-items: center; cursor: pointer; }

.reply { border-radius: var(--radius); padding: 18px; margin-top: 26px; }
.reply-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.reply-head .chip { font-size: 15px; padding: 8px 16px; font-weight: 500; }
.reply-head .roundico { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; background: #fff; color: var(--ink); box-shadow: 0 4px 12px -4px rgba(14, 30, 21, .35); }
.reply h2 { color: var(--ink-2); margin: 0 0 8px; font-size: 15px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.chipbtn { padding: 0 16px; }
.chipbtn.on { background: linear-gradient(180deg, #4f6a58, #34493c); color: #fff; }
.checks { margin: 0 0 8px; padding-left: 18px; color: var(--amber); font-size: 14px; }
.checks.off, .checks:empty { display: none; }
.notes { margin: 0 0 8px; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.nodrafts { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-2); }
.edit { width: 100%; font: inherit; letter-spacing: inherit; font-size: 16px; padding: 14px 16px; border-radius: 22px; border: 0;
  background: rgba(255, 255, 255, .62); color: var(--ink); resize: vertical;
  box-shadow: inset 0 1px 3px rgba(14, 30, 21, .12), inset 0 0 0 1px rgba(255, 255, 255, .7); }
.edit.hasdash { box-shadow: inset 0 0 0 2px var(--red); }
.dashwarn { color: var(--red); font-size: 14px; margin: 4px 0; }
.actions { display: flex; gap: 8px; margin-top: 12px; }
.actions .primary { flex: 1; }
.hint { color: var(--ink-2); font-size: 14px; margin: 6px 0 0; }
.doneform { margin-top: 14px; }
.doneform button { width: 100%; }
.saved { color: var(--ink-2); font-size: 13px; margin: 4px 2px 0; min-height: 1em; }
.working { color: var(--ink-2); font-size: 14px; }
.error { color: var(--red); background: var(--red-bg); padding: 10px 14px; border-radius: 16px; margin: 0; font-size: 15px; }
.reply .error { margin-top: 10px; }
.regenbox { margin-top: 10px; }
.regenbox input, .unpause input[type=password], .login-card input[type=password] { width: 100%; min-height: 50px; font: inherit;
  font-size: 16px; padding: 0 18px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .7); color: var(--ink);
  box-shadow: inset 0 1px 3px rgba(14, 30, 21, .12), inset 0 0 0 1px rgba(255, 255, 255, .8); }
.banner { padding: 11px 15px; font-size: 15px; border-radius: 20px; margin: 10px 0; }
.banner.amber { background: var(--amber-bg); color: var(--amber); }
.banner.note { background: rgba(255, 255, 255, .86); color: var(--ink); }
.banner.nopitch, .sheet-warn { background: var(--red-bg); color: var(--red); box-shadow: inset 0 0 0 2px var(--red); border-radius: 20px; }

/* result card + confirm sheet */
.card { border-radius: 22px; padding: 12px 14px; margin: 4px 0 12px; }
.card.green, .card.green.blur { background: linear-gradient(165deg, #e6f5ea, #d0eada); color: #14532d; }
.card.amber, .card.amber.blur { background: var(--amber-bg); color: var(--amber); }
.card.red, .card.red.blur { background: var(--red-bg); color: var(--red); }
.card-title { font-weight: 700; }
.card-text { font-size: 15px; margin-top: 2px; overflow-wrap: anywhere; }
.settle { display: flex; gap: 8px; margin-top: 10px; }
.settle button { flex: 1; }
.settle button.armed { background: var(--red); color: #fff; }
.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(12, 26, 18, .42); display: flex; align-items: flex-end; }
.sheet[hidden] { display: none; }
.sheet-body { width: 100%; max-height: 92vh; overflow: auto; border-radius: 32px 32px 0 0;
  padding: 12px 18px calc(var(--safe-b) + 18px); background: linear-gradient(172deg, rgba(244, 249, 245, .9), rgba(222, 233, 226, .86)); }
.sheet:not([hidden]) .sheet-body { animation: sheet-up .5s var(--ease-drawer) both; }
.sheet:not([hidden]) { animation: fade-in .3s ease both; }
@keyframes sheet-up { from { transform: translate3d(0, 100%, 0); } }
@keyframes fade-in { from { opacity: 0; } }
.sheet-body h2 { color: var(--ink); margin-left: 0; font-weight: 600; font-size: 17px; }
.sheet-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0 0 10px; font-size: 15px; }
.sheet-meta dt { color: var(--ink-2); }
.sheet-meta dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.sheet-text { white-space: pre-wrap; overflow-wrap: anywhere; background: rgba(255, 255, 255, .72); border-radius: 18px; padding: 12px 14px; }
.sheet-mode { color: var(--red); font-size: 14px; }
.sheet-actions { display: flex; gap: 8px; margin-top: 14px; }
.sheet-actions .primary { flex: 1; }
.row-msg { font-size: 14px; color: var(--ink-2); margin-top: 4px; }

/* ---------- login / unpause ---------- */
body.login main { min-height: 100vh; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
  padding-top: calc(env(safe-area-inset-top, 0px) + 9vh); }
.login-hero { padding: 0 6px 22px; }
.login-hero h1 { font-size: 40px; }
.login-card { border-radius: var(--radius); padding: 22px 20px; width: 100%; display: flex; flex-direction: column; gap: 12px; }
.login-card label { font-size: 15px; color: var(--ink-2); font-weight: 500; }
.login-card .chip { align-self: flex-start; font-size: 15px; padding: 8px 16px; }
.hidden-user { position: absolute; left: -9999px; width: 1px; height: 1px; }
.unpause { border-radius: var(--radius); padding: 18px; margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.unpause h2 { color: var(--ink); margin: 0; }
.unpause form { display: flex; flex-direction: column; gap: 10px; }
.unpause a { min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- dock: a glass pill with a sliding white circle, and a separate round glass menu button ---------- */
.dock { position: fixed; left: 0; right: 0; bottom: calc(var(--safe-b) + 14px); z-index: 20; display: flex; justify-content: center;
  align-items: center; gap: 12px; padding: 0 16px; pointer-events: none; }
.dock-pill, .dock-more summary { pointer-events: auto;
  background: linear-gradient(180deg, rgba(132, 156, 140, .58), rgba(74, 99, 84, .58));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 0 0 1px rgba(255, 255, 255, .2), 0 16px 34px -14px rgba(10, 24, 16, .6); }
.dock-pill, .dock-more summary { -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); }
.dock-pill { position: relative; display: flex; align-items: center; gap: 14px; padding: 7px; border-radius: 999px; }
.dock-btn { position: relative; z-index: 1; width: 58px; height: 58px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; color: #fff; text-decoration: none; transition: color .25s ease; }
.dock-ind { position: absolute; left: 0; top: 7px; width: 58px; height: 58px; border-radius: 50%; z-index: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 38%, #ffffff 58%, #edf3ef 100%);
  box-shadow: 0 0 26px 6px rgba(255, 255, 255, .5), 0 6px 14px -4px rgba(10, 24, 16, .35); will-change: transform; }
.dock-pill.has-ind .dock-btn.lit, .dock-pill:not(.has-ind) .dock-btn.on { color: #2c4436; }
.dock-pill:not(.has-ind) .dock-btn.on { background: radial-gradient(circle at 50% 38%, #fff 58%, #edf3ef 100%);
  box-shadow: 0 0 26px 6px rgba(255, 255, 255, .5); }
.dock-more { position: relative; pointer-events: auto; }
.dock-more summary { list-style: none; width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; color: #fff; cursor: pointer; transition: background-color .25s ease, color .25s ease; }
.dock-more summary::-webkit-details-marker { display: none; }
.dock-more[open] summary { background: rgba(255, 255, 255, .94); color: #2c4436; }
.menu-body { position: absolute; right: 0; bottom: 86px; min-width: 254px; padding: 8px; border-radius: 26px; display: flex;
  flex-direction: column; gap: 2px; color: var(--ink); transform-origin: 85% 100%;
  background: linear-gradient(172deg, rgba(246, 250, 247, .97), rgba(228, 237, 231, .95));
  -webkit-backdrop-filter: blur(26px) saturate(170%); backdrop-filter: blur(26px) saturate(170%);
  box-shadow: inset 0 1px 0 #fff, 0 22px 48px -16px rgba(10, 24, 16, .6); }
.dock-more[open] .menu-body { animation: menu-in .38s var(--spring-soft) both; }
@keyframes menu-in { from { opacity: 0; transform: scale(.92) translate3d(0, 8px, 0); } }
.menu-body a, .menu-body button { min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 14px; width: 100%;
  text-decoration: none; color: var(--ink); border-radius: 18px; background: transparent; border: 0; box-shadow: none;
  font-size: 16px; font-weight: 500; text-align: left; }
.menu-body a:active, .menu-body button:active { background: rgba(255, 255, 255, .7); }
.menu-body button.danger { color: var(--red); }
.menu-body form { margin: 0; }

/* ---------- pull to refresh ---------- */
.ptr { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 8px); z-index: 25; width: 40px; height: 40px;
  border-radius: 50%; opacity: 0; pointer-events: none; transform: translate3d(-50%, 0, 0);
  background: rgba(255, 255, 255, .9); box-shadow: 0 8px 20px -8px rgba(10, 24, 16, .5); }
.ptr i { position: absolute; inset: 11px; border-radius: 50%; border: 2.5px solid #4f6a58; border-right-color: transparent; }
.ptr.armed { background: #fff; }
.ptr.spin i { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- lead tracker (/crm) ---------- */
.quiet { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 10px 0 0; font-size: 14px; color: var(--on-bg);
  width: fit-content; max-width: 100%; padding: 6px 14px 6px 10px; border-radius: 999px; background: var(--tag);
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); }
.quiet .crm-age { all: unset; display: inline; }
.quiet .sep { opacity: .7; }
.quiet .ic { opacity: .9; }
.crm-note { display: table; font-size: 14px; color: var(--on-bg); margin: 8px 0 0; padding: 6px 14px; border-radius: 999px; background: var(--tag);
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); }
.jump { display: flex; flex-wrap: nowrap; gap: 8px; margin: 18px -16px 4px; padding: 6px 16px 12px; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: 16px;
  -webkit-mask: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 28px), transparent);
  mask: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 28px), transparent); }
.jump::-webkit-scrollbar { display: none; }
.jump a { flex: none; scroll-snap-align: start; white-space: nowrap; }
.jump a { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; border-radius: 999px;
  text-decoration: none; color: var(--ink); background: var(--chip); font-size: 15px; font-weight: 500;
  box-shadow: inset 0 1px 0 #fff, 0 8px 18px -10px rgba(14, 30, 21, .55); }
.jump a b { font-weight: 600; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: #e3ebe5;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.jump a.hot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--warm); box-shadow: 0 0 0 3px rgba(196, 98, 58, .18); }
.lead-sec { scroll-margin-top: 16px; }
.lead-sec h2 .ic { opacity: .95; }
.row.lead .who { white-space: normal; overflow-wrap: anywhere; }
.row.lead .chip.stage { flex: none; max-width: 48%; }
.row.lead.money, .lead-sec .rows > li > .row.lead.money { box-shadow: inset 0 0 0 2px var(--gold), 0 0 0 4px rgba(212, 170, 80, .22), var(--shadow); }
.money-tag { color: #7a5a12; display: inline-flex; vertical-align: -4px; }
.row.nolink { cursor: default; }
.lead-sub { font-size: 14px; color: var(--ink-2); margin-top: 2px; overflow-wrap: anywhere; }
.lead-next, .lead-last { font-size: 15px; margin-top: 8px; overflow-wrap: anywhere; display: flex; gap: 8px; align-items: flex-start; }
.lead-next .ic, .lead-last .ic { margin-top: 2px; color: var(--ink-2); }
.lead-next .date { background: rgba(255, 255, 255, .86); border-radius: 999px; padding: 1px 9px; font-size: 14px; white-space: nowrap; }
.lead-quote { font-size: 15px; color: var(--ink); margin-top: 10px; overflow-wrap: anywhere; display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-align: center; padding: 0 6px; }
.lead-quote::before { content: "\201C"; } .lead-quote::after { content: "\201D"; }
.lead-why { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.lead-why li { background: #fff; color: var(--ink); border-radius: 999px; padding: 3px 10px; display: inline-flex; align-items: center;
  gap: 7px; font-weight: 500; overflow-wrap: anywhere; }
.lead-why li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--warm); flex: none; }
.nothread { font-size: 13px; color: var(--ink); margin-top: 8px; }

/* ---------- motion ---------- */
/* entrance: boot.js sets html.pre before paint; motion.js marks first-screen pieces .rin (stagger) and the rest .rin0 */
html.pre :is(.hero, .login-hero, .login-card, .statechip, .crm-age, .crm-note, .jump, .thead, .banner, .empty,
  #list h2, .lead-sec h2, .rows > li, .chat > li, .reply, .unpause, .actions) { opacity: 0; transform: translate3d(0, 18px, 0) scale(.985); }
html.pre .rin0 { opacity: 1; transform: none; }
html.pre.go .rin { opacity: 1; transform: none;
  transition: opacity .55s var(--ease-out) var(--d, 0ms), transform .8s var(--spring-soft) var(--d, 0ms); }

@media (prefers-reduced-motion: no-preference) {
  /* press: sinks at once, springs back on release (interruptible: it is a transition from the live value) */
  .row, .jump a, button, .dock-btn, .dock-more summary, .roundbtn, .back, .ext, .done-list summary h2 {
    transition: transform .55s var(--spring-press), color .25s ease; }
  .row:active, .jump a:active, button:active, .roundbtn:active, .back:active { transform: scale(.97); transition: transform .12s var(--ease-out); }
  .dock-btn:active, .dock-more summary:active { transform: scale(.9); transition: transform .12s var(--ease-out); }
  .done-list summary:active h2 { transform: scale(.96); transition: transform .12s var(--ease-out); }
  h2.ping { animation: ping .7s var(--spring-press); }
  @keyframes ping { 30% { transform: scale(1.06); } }

  /* cross-document view transitions (Safari 18.2+): a thread rises like a sheet, back drops it down */
  @view-transition { navigation: auto; }
  .bg-gl { view-transition-name: bg; }
  .dock { view-transition-name: dock; }
  main { view-transition-name: page; }
  ::view-transition-group(bg), ::view-transition-group(dock) { animation: none; }
  ::view-transition-old(bg) { display: none; }
  ::view-transition-new(bg), ::view-transition-old(dock), ::view-transition-new(dock) { animation: none; }
  ::view-transition-group(page) { animation-duration: .45s; animation-timing-function: var(--ease-drawer); }
  html:active-view-transition-type(up)::view-transition-old(page) { animation: vt-recede .45s var(--ease-drawer) both; }
  html:active-view-transition-type(up)::view-transition-new(page) { animation: vt-rise .45s var(--ease-drawer) both; }
  html:active-view-transition-type(down)::view-transition-old(page) { animation: vt-drop .4s var(--ease-drawer) both; }
  html:active-view-transition-type(down)::view-transition-new(page) { animation: vt-return .4s var(--ease-drawer) both; }
  @keyframes vt-rise { from { opacity: 0; transform: translate3d(0, 56px, 0); } }
  @keyframes vt-recede { to { opacity: 0; transform: scale(.95); } }
  @keyframes vt-drop { to { opacity: 0; transform: translate3d(0, 56px, 0); } }
  @keyframes vt-return { from { opacity: 0; transform: scale(.95); } }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media (prefers-reduced-transparency: reduce) {
  .row.blur, .pane.blur, .reply.blur, .card.blur, .login-card.blur, .unpause.blur, .msg.in.blur, .msg.out.blur, .sheet-body, .menu-body {
    background: linear-gradient(172deg, #eef3ef, #dce6df); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* focus: a soft ring (WebKit's red :invalid ring on the empty required password looked like an error) */
input, textarea { outline: none; }
input:invalid, textarea:invalid { box-shadow: inset 0 1px 3px rgba(14, 30, 21, .12), inset 0 0 0 1px rgba(255, 255, 255, .8); }
input:focus-visible, textarea:focus-visible, input:focus, textarea:focus {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9), 0 0 0 3px rgba(255, 255, 255, .6), 0 0 0 5px rgba(63, 92, 75, .45); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid rgba(255, 255, 255, .9); outline-offset: 2px; }
.lead-sec .rows > li:first-child > .row.lead.money { box-shadow: inset 0 0 0 2px var(--gold), 0 0 0 4px rgba(212, 170, 80, .22),
  0 -16px 0 -9px rgba(236, 244, 239, .34), 0 -30px 0 -19px rgba(236, 244, 239, .2), var(--shadow); }

/* ---------- second glass depth (the reference's streak card): darker, more see-through, white text ---------- */
.row.deep, .row.deep.blur { color: #fff;
  background: radial-gradient(70% 60% at 25% 20%, rgba(255, 255, 255, .10), transparent 70%),
    linear-gradient(135deg, rgba(40, 62, 50, .58), rgba(26, 44, 35, .70));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), var(--shadow); }
.row.deep::after { background: linear-gradient(180deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, .06) 45%, rgba(255, 255, 255, .14)); }
.row.deep::before { display: none; }
.row.deep .age, .row.deep .row-sub, .row.deep .lead-sub, .row.deep .lead-next .ic, .row.deep .lead-last .ic, .row.deep .nothread { color: rgba(255, 255, 255, .9); }
.row.deep .preview, .row.deep .lead-quote { color: #fff; }
.row.deep .lead-next .date { background: rgba(255, 255, 255, .18); color: #fff; }
.row.deep .badge { background: rgba(255, 255, 255, .16); color: #fff; }
.row.deep .badge.red, .row.deep .badge.amber { background: rgba(255, 255, 255, .16); color: #fff; }
.row.deep .need-dot { background: #a6efbd; }
/* status chips as small deep-glass tags on the pale cards */
.row.lead .chip.stage { background: rgba(32, 52, 41, .78); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); }
.row.deep .chip.stage { background: rgba(255, 255, 255, .92); color: var(--ink); }

/* ---------- reply-first home: one card per person who wrote last ---------- */
.rows.needs { margin-top: 4px; }
.row.need .said { font-size: 15px; color: var(--ink); margin-top: 10px; overflow-wrap: anywhere; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row.need .said::before { content: "\201C"; } .row.need .said::after { content: "\201D"; }
.row.need .age { color: var(--ink-2); }
.row.need.money .who { color: #3a2a06; }
.row.need.money { box-shadow: inset 0 0 0 2px var(--gold), 0 0 0 4px rgba(212, 170, 80, .22), var(--shadow); }
.rows > li:first-child > .row.need.money { box-shadow: inset 0 0 0 2px var(--gold), 0 0 0 4px rgba(212, 170, 80, .22),
  0 -16px 0 -9px rgba(236, 244, 239, .34), 0 -30px 0 -19px rgba(236, 244, 239, .2), var(--shadow); }
.elsewhere { display: flex; align-items: center; gap: 10px; min-height: 48px; margin: 18px 0 0; padding: 0 16px;
  border-radius: 999px; background: var(--tag); color: var(--on-bg); font-size: 15px; font-weight: 500; text-decoration: none;
  width: fit-content; max-width: 100%; }
.elsewhere span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.elsewhere .ic-chev { opacity: .8; margin-left: 2px; }

/* ---------- thread: Suggested reply ---------- */
.reply-head h2.chip { margin: 0; color: var(--ink); font-size: 15px; padding: 8px 16px; font-weight: 600; }
.actions.four { display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  grid-template-areas: "ask ask" "copy regen" "send send"; }
.actions.four #askai { grid-area: ask; } .actions.four #copy { grid-area: copy; }
.actions.four #regen { grid-area: regen; } .actions.four #send { grid-area: send; }
.actions.four button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px;
  min-height: 50px; font-weight: 500; white-space: nowrap; }
.actions.four button:not(.primary) { background: var(--chip); color: var(--ink); }
.actions.four #askai { background: linear-gradient(180deg, #ffffff, #eef5f0); }
button.primary.off { background: linear-gradient(180deg, #8a9a8f, #6f8075); color: #fff; }
.sendoff { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 9px 14px; border-radius: 16px;
  background: var(--tag); color: var(--on-bg); font-size: 14px; font-weight: 500; }
.sendoff.flash { animation: nudge .45s var(--ease-out); }
@keyframes nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 60% { transform: translateX(4px); } }
.noreply { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 18px; margin: 0 0 12px;
  background: rgba(255, 255, 255, .86); color: var(--ink); font-size: 15px; }
.noreply b { display: inline-flex; align-items: center; gap: 6px; }
.noreply button { align-self: flex-start; margin-top: 8px; }
.revised { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 2px 0; font-size: 14px;
  color: var(--ink-2); font-style: italic; }
.revised button { font-style: normal; display: inline-flex; align-items: center; gap: 6px; background: var(--chip); color: var(--ink);
  padding: 0 14px; }
.reply .working { margin: 10px 2px 0; }
.debug { margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.debug summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; text-decoration: underline; }
.debug dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0 0 4px; }
.debug dt { color: var(--ink-2); }
.debug dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); }
.debug code { font: 500 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.chips.quick { margin: 4px 0 12px; }
.chips.quick button { background: var(--chip); color: var(--ink); font-weight: 500; box-shadow: inset 0 0 0 1px rgba(23, 33, 27, .12); }
#revise input { width: 100%; min-height: 50px; font: inherit; font-size: 16px; padding: 0 16px; border-radius: 16px; border: 0;
  background: rgba(255, 255, 255, .92); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(23, 33, 27, .14); }

/* an open sheet owns the bottom of the screen: the dock steps aside (main is its own stacking context) */
body:has(.sheet:not([hidden])) .dock { opacity: 0; pointer-events: none; transform: translateY(24px);
  transition: opacity .18s ease, transform .25s var(--ease-out); }
.dock { transition: opacity .25s ease, transform .35s var(--ease-out); }
.sheet-body { padding-bottom: calc(var(--safe-b) + 20px); }
