/* Tsanex Messaging — the product page.
   Extends styles.css and shares its tokens, header, footer and form. What is
   here belongs to this page only: the editor and phone in the hero, the
   per-recipient roster, the two data sheets, the comparison table and the FAQ. */

:root {
  --wa-head:  #0f6b46;
  --rcs-head: #1c3f6e;
  --sms-head: #3f3d56;
  --alert:    #b4231a;
  --alert-bg: #fdeeec;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.prod-hero { padding-block: clamp(2.75rem, 6vw, 4.25rem); }

.prod-intro { max-width: 44rem; }
.prod-intro .hero-lede { max-width: 38em; }
.prod-intro .hero-actions { margin-top: 1.75rem; }

/* Editor and phone side by side: the thing you change and the thing that
   changes. Below 62rem they stack in that order, which is also the order they
   make sense in. */
.studio {
  margin-top: clamp(2.25rem, 5vw, 3.25rem);
  display: grid; gap: clamp(1.75rem, 4vw, 3rem);
  grid-template-columns: 1fr; align-items: start;
}
@media (min-width: 62rem) { .studio { grid-template-columns: 1fr 22rem; } }

.studio-editor {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh);
  padding: clamp(1.25rem, 3vw, 1.75rem);
}

.studio-head { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.studio-label { font-family: var(--display); font-weight: 600; font-size: .95rem; color: var(--ink); }
.studio-hint { font-size: .82rem; color: var(--muted); }

.studio-editor textarea {
  margin-top: .7rem; width: 100%; resize: vertical;
  font-family: var(--text); font-size: 1rem; line-height: 1.6; color: var(--ink);
  background: var(--soft); border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: .85rem 1rem;
}
.studio-editor textarea:focus { background: var(--white); border-color: var(--brand); }

.chips { margin-top: .85rem; display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.chips-label { font-size: .82rem; color: var(--muted); margin-right: .2rem; }
.chips button {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: .78rem; color: var(--brand-dark);
  background: var(--brand-50); border: 1px solid var(--brand-100);
  border-radius: 999px; padding: .3rem .7rem; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.chips button:hover { background: var(--brand-100); border-color: var(--brand-200); }

/* The readout. Three numbers, because three numbers are what the network
   charges on. */
.meter {
  margin-top: 1.25rem; padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
/* `hidden` loses to a display declaration, and this one has three. */
.meter[hidden] { display: none; }
.meter div { display: grid; gap: .2rem; }
.meter b {
  font-family: var(--display); font-weight: 700; font-size: 1.35rem;
  color: var(--brand); line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color .2s ease;
}
.meter span { font-size: .8rem; color: var(--muted); }
.meter-alert b { color: var(--alert); }

.meter-rich {
  margin-top: 1.25rem; padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  font-size: .92rem; color: var(--body);
}

.meter-warn {
  margin-top: .9rem; padding: .7rem .9rem;
  background: var(--alert-bg); border-radius: var(--r-sm);
  font-size: .87rem; line-height: 1.5; color: #8f1c15;
}

/* ── Channel switch ───────────────────────────────────────────────────── */

.chan-switch {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: .25rem; padding: .3rem;
  background: var(--white); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: var(--sh-sm);
  margin: 0 auto 1.25rem; max-width: 20rem;
}
.chan-switch button {
  font-family: var(--display); font-weight: 600; font-size: .86rem;
  padding: .5rem .4rem; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: background-color .22s ease, color .22s ease;
}
.chan-switch button:hover { color: var(--brand-dark); }
.chan-switch button[aria-selected="true"] { background: var(--brand); color: #fff; }

/* ── Phone ────────────────────────────────────────────────────────────── */

.studio-preview { justify-self: center; width: min(100%, 22rem); }

/* A thin bezel reads as a phone without pretending to be one particular
   handset. */
.phone-shell { border-radius: 2.1rem; background: #16152a; padding: .55rem; box-shadow: var(--sh-lg); }

.phone-status {
  display: flex; justify-content: space-between; align-items: center;
  padding: .35rem 1.1rem .5rem;
  font-family: var(--display); font-size: .72rem; font-weight: 600; color: #b9b6d4;
}
.phone-status-icons { display: inline-flex; gap: 3px; align-items: flex-end; }
.phone-status-icons i { width: 3px; background: #b9b6d4; border-radius: 1px; }
.phone-status-icons i:nth-child(1) { height: 5px; }
.phone-status-icons i:nth-child(2) { height: 8px; }
.phone-status-icons i:nth-child(3) { height: 11px; }

.phone-app {
  background: #f4f4f9; border-radius: 1.65rem; overflow: hidden;
  min-height: 25rem; display: flex; flex-direction: column;
}

.phone-head {
  display: flex; align-items: center; gap: .65rem;
  padding: .85rem 1rem;
  background: var(--rcs-head); color: #fff;
  transition: background-color .3s ease;
}
.phone[data-channel="whatsapp"] .phone-head { background: var(--wa-head); }
.phone[data-channel="sms"]      .phone-head { background: var(--sms-head); }

.phone-avatar {
  display: grid; place-items: center; flex: none;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: rgba(255,255,255,.18);
  font-family: var(--display); font-weight: 700; font-size: 1.05rem;
}
.phone-who { display: grid; line-height: 1.25; min-width: 0; }
.phone-name { font-family: var(--display); font-weight: 600; font-size: .95rem; }
.phone-sub  { font-size: .7rem; color: rgba(255,255,255,.78); }
.phone[data-channel="sms"] .phone-sub { visibility: hidden; }

.phone-thread { flex: 1; padding: .9rem .8rem 1.1rem; display: grid; gap: .45rem; align-content: start; }

/* The one orchestrated moment on the page: the thread arrives message by
   message, on load and on every channel switch. Everything else holds still. */
.phone.playing .phone-thread > * { animation: rise .42s cubic-bezier(.22,.8,.3,1) both; }
.phone.playing .phone-thread > *:nth-child(1) { animation-delay: .04s; }
.phone.playing .phone-thread > *:nth-child(2) { animation-delay: .36s; }
.phone.playing .phone-thread > *:nth-child(3) { animation-delay: .8s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(9px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.msg { border-radius: 1.05rem; overflow: hidden; max-width: 15.5rem; }

.msg-out { background: #fff; box-shadow: var(--sh-sm); border-top-left-radius: .35rem; }
.card-media svg { display: block; width: 100%; height: auto; }

/* SMS has no media and no buttons, and the preview says so by not drawing
   them rather than by drawing them greyed out. */
.phone[data-channel="sms"] .card-media,
.phone[data-channel="sms"] .card-actions { display: none; }

.msg-body {
  padding: .7rem .85rem;
  font-size: .82rem; line-height: 1.5; color: var(--body);
  overflow-wrap: anywhere;
}

.card-actions { display: grid; border-top: 1px solid var(--line-2); }
/* Spans, not buttons: they illustrate what a recipient sees and must not turn
   up in the tab order of a page that has real controls on it. */
.card-actions span {
  font-family: var(--display); font-weight: 600; font-size: .8rem;
  padding: .55rem .5rem; text-align: center; color: var(--rcs);
}
.card-actions span + span { border-top: 1px solid var(--line-2); }
.phone[data-channel="whatsapp"] .card-actions span { color: var(--wa); }

.msg-in {
  margin-left: auto; background: var(--brand); color: #fff;
  border-top-right-radius: .35rem;
  padding: .6rem .85rem; font-size: .82rem; line-height: 1.45; max-width: 13rem;
}
.phone[data-channel="whatsapp"] .msg-in { background: var(--wa-head); }
.phone[data-channel="sms"]      .msg-in { background: var(--sms-head); }

.msg-meta { font-size: .68rem; color: var(--muted); padding-left: .3rem; margin-top: -.15rem; }

.studio-for { margin-top: 1rem; text-align: center; font-size: .85rem; color: var(--muted); }
.studio-for b { color: var(--ink); font-weight: 600; }

/* ── Roster ───────────────────────────────────────────────────────────── */

.roster-wrap { overflow-x: auto; }

.roster { width: 100%; min-width: 46rem; border-collapse: collapse; font-size: .93rem; }
.roster th, .roster td { text-align: left; padding: .9rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.roster thead th {
  font-family: var(--display); font-weight: 600; font-size: .85rem; color: var(--muted);
  border-bottom: 2px solid var(--brand-200); padding-bottom: .6rem;
}
.roster tbody th { font-family: var(--text); font-weight: 600; color: var(--ink); white-space: nowrap; }
.roster tbody tr:last-child th, .roster tbody tr:last-child td { border-bottom: 0; }

/* The rendered message, set in mono so the substituted value reads as data. */
.roster-msg {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: .8rem; color: var(--body);
}

.pill {
  display: inline-block; font-family: var(--display); font-weight: 600; font-size: .76rem;
  padding: .22rem .6rem; border-radius: 999px; white-space: nowrap;
}
.pill-rcs { color: var(--rcs); background: #e7f1fa; }
.pill-wa  { color: var(--wa);  background: #e8f6ee; }
.pill-sms { color: var(--sms); background: #e6f5f3; }
.pill-arrow { color: var(--muted); margin-inline: .3rem; font-size: .8rem; }

.state { font-size: .86rem; white-space: nowrap; }
.state::before {
  content: ""; display: inline-block; vertical-align: middle;
  width: .45rem; height: .45rem; border-radius: 50%; margin-right: .5rem;
  background: currentColor;
}
.state-ok    { color: #0f7a3f; }
.state-read  { color: var(--brand); }
.state-click { color: #a3600c; }
.state-bad   { color: var(--alert); }

.roster-note { margin-top: 1.4rem; font-size: .92rem; color: var(--muted); max-width: 48em; }

/* ── Data sheets ──────────────────────────────────────────────────────── */

.sheet {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh);
  padding: 1.5rem 1.6rem 1.35rem;
}
.sheet-head { font-family: var(--display); font-weight: 600; color: var(--ink); }

.sheet-rows { margin: 1.1rem 0 0; display: grid; gap: 0; }
.sheet-rows > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem;
  padding: .75rem 0; border-bottom: 1px solid var(--line-2);
}
.sheet-rows > div:last-child { border-bottom: 0; }
.sheet-rows dt { font-size: .92rem; color: var(--muted); }
.sheet-rows dd {
  margin: 0; text-align: right;
  font-family: var(--display); font-weight: 600; font-size: .98rem; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
/* The line that would have cost money. It is the reason the dry run exists, so
   it is the one line that is not grey. */
.sheet-flag dd { color: var(--alert); }

.sheet-foot { margin-top: 1rem; font-size: .78rem; color: var(--muted); }

/* ── Use cases ────────────────────────────────────────────────────────── */

.uses { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .uses { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 66rem) { .uses { grid-template-columns: repeat(3, 1fr); } }

.use {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1.35rem 1.4rem 1.2rem;
  box-shadow: var(--sh-sm);
  display: grid; align-content: start; gap: .5rem;
}
.use p { font-size: .94rem; }
.use q {
  quotes: none; margin-top: .35rem; padding: .6rem .8rem;
  background: var(--brand-50); border-radius: var(--r-sm);
  font-size: .87rem; line-height: 1.45; color: var(--brand-deep);
}

/* ── Features ─────────────────────────────────────────────────────────── */

.feats { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .feats { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 66rem) { .feats { grid-template-columns: repeat(3, 1fr); } }

.feat { border: 1px solid var(--line); border-radius: var(--r); padding: 1.3rem 1.4rem; background: var(--white); }
.feat p { margin-top: .45rem; font-size: .94rem; }

/* ── Outcome grid ─────────────────────────────────────────────────────── */

/* One cell per recipient. The section claims the report does not work in
   averages; this is that claim drawn rather than repeated. */
.outcome {
  margin: clamp(2.25rem, 5vw, 3rem) 0 0;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm);
  padding: clamp(1.25rem, 3vw, 1.75rem);
}
.outcome-head { font-family: var(--display); font-weight: 600; color: var(--ink); }

.outcome-grid {
  display: block; width: 100%; height: auto;
  margin-top: 1.1rem;
  /* The wipe is applied by script, so a browser that never runs it shows the
     figure rather than an empty box. One clip-path draws all 1,248 cells;
     animating each would be a thousand compositor layers for an effect nobody
     reads as separate. */
  transition: clip-path 1.1s cubic-bezier(.3,.7,.3,1);
}
.outcome-grid.wipe { clip-path: inset(0 100% 0 0); }
.outcome-grid.wipe.drawn { clip-path: inset(0 0 0 0); }

.c-read  { fill: #453ca3; }
.c-ok    { fill: #cfcbec; }
.c-click { fill: #d99425; }
.c-reply { fill: #0f7a3f; }
.c-bad   { fill: #b4231a; }

.legend { list-style: none; margin: 1.4rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; }
.legend li { display: flex; align-items: baseline; gap: .45rem; font-size: .88rem; color: var(--muted); }
.legend b { font-family: var(--display); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.sw { width: .7rem; height: .7rem; border-radius: 2px; align-self: center; }
.sw-read { background: var(--brand); }
.sw-ok { background: var(--brand-200); }
.sw-click { background: #d99425; }
.sw-reply { background: #0f7a3f; }
.sw-bad { background: var(--alert); }

.outcome-note { margin-top: 1rem; font-size: .8rem; color: var(--muted); max-width: 52em; }

/* ── Campaign tally ───────────────────────────────────────────────────── */

/* What drives the number, rather than the balance moving up and down. The SMS
   row is the point: 135 messages, 178 units. */
.tally {
  margin: 0 0 clamp(2rem, 4vw, 2.75rem);
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm);
  padding: clamp(1.25rem, 3vw, 1.75rem);
}
.tally-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .85rem; }
.tally-head b { font-family: var(--display); font-weight: 600; color: var(--ink); }
.tally-head span { font-size: .88rem; color: var(--muted); }

.tally-rows { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; gap: 1.1rem; }

/* name | bar | units, with the detail line under the bar on a second row. */
.tally-rows li {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  align-items: center;
  column-gap: 1rem; row-gap: .35rem;
}
@media (max-width: 34rem) {
  .tally-rows li { grid-template-columns: 1fr auto; }
  .tally-name { grid-column: 1; }
  .tally-units { grid-column: 2; }
  .tally-track { grid-column: 1 / -1; order: 3; }
  .tally-detail { grid-column: 1 / -1; order: 4; }
}

.tally-name { font-family: var(--display); font-weight: 600; font-size: .95rem; color: var(--ink); }

.tally-track { display: block; height: .85rem; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.tally-bar {
  display: block; height: 100%; width: var(--w); border-radius: 999px;
  transform: scaleX(0); transform-origin: left;
  transition: transform .6s cubic-bezier(.22,.8,.3,1);
}
.bar-rcs { background: var(--rcs); }
.bar-wa  { background: var(--wa); }
.bar-sms { background: var(--sms); }

.drawn .tally-rows li:nth-child(1) .tally-bar { transition-delay: 0s; }
.drawn .tally-rows li:nth-child(2) .tally-bar { transition-delay: .12s; }
.drawn .tally-rows li:nth-child(3) .tally-bar { transition-delay: .24s; }
.drawn .tally-bar { transform: scaleX(1); }

.tally-units {
  font-family: var(--display); font-weight: 700; font-size: 1.05rem;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.tally-detail { grid-column: 2 / -1; font-size: .84rem; color: var(--muted); }
@media (max-width: 34rem) { .tally-detail { grid-column: 1 / -1; } }

.tally-sum {
  margin: 1.5rem 0 0; padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: .6rem 2.5rem;
}
.tally-sum > div { display: grid; gap: .2rem; }
.tally-sum dt { font-size: .82rem; color: var(--muted); }
.tally-sum dd {
  margin: 0; font-family: var(--display); font-weight: 700; font-size: 1.15rem;
  color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums;
}
.tally-credit dd { color: #0f7a3f; }
.tally-total dd { color: var(--brand); }
.tally-unit { font-family: var(--text); font-weight: 400; font-size: .86rem; color: var(--muted); }

.tally-foot { margin-top: 1.25rem; font-size: .8rem; color: var(--muted); max-width: 54em; }

/* ── Channel trio ─────────────────────────────────────────────────────── */

/* The table below says what each channel can do. This says what it looks
   like, which is the faster answer. */
.trio { display: grid; gap: 1.25rem; grid-template-columns: 1fr; margin-bottom: clamp(2.25rem, 5vw, 3rem); }
@media (min-width: 48rem) { .trio { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; } }

.trio-item { margin: 0; display: grid; gap: .9rem; }

.screen {
  border-radius: var(--r-lg);
  padding: 1.1rem 1rem 1.6rem;
  min-height: 13rem;
  display: flex; align-items: flex-start;
}
.screen-rcs { background: #eef3f9; }
.screen-wa  { background: #eaf5ef; }
.screen-sms { background: #eff0f4; }

.mini {
  background: #fff; border-radius: .9rem; overflow: hidden;
  box-shadow: 0 1px 2px rgba(27,26,46,.08), 0 6px 14px -8px rgba(27,26,46,.25);
  width: 100%; max-width: 14.5rem;
  border-top-left-radius: .3rem;
}
.mini-media {
  height: 3.6rem;
  background: linear-gradient(135deg, #4c43b2, #8a7fd8);
}
.mini b, .mini p, .mini em { display: block; padding-inline: .7rem; }
.mini b {
  padding-top: .6rem; font-family: var(--display); font-size: .84rem; color: var(--ink);
}
.mini p { padding-top: .25rem; padding-bottom: .65rem; font-size: .76rem; line-height: 1.45; color: var(--body); }
.mini em { padding-bottom: .65rem; margin-top: -.35rem; font-style: normal; font-size: .66rem; color: var(--muted); }

.mini-actions { display: grid; border-top: 1px solid var(--line-2); }
.mini-actions span {
  font-family: var(--display); font-weight: 600; font-size: .74rem;
  padding: .45rem .4rem; text-align: center; color: var(--rcs);
}
.mini-actions span + span { border-top: 1px solid var(--line-2); }
.mini-wa .mini-actions span { color: var(--wa); }

.mini-sms p { padding-block: .65rem; }

.trio-item figcaption { display: grid; gap: .2rem; }
.trio-item figcaption b { font-family: var(--display); font-size: .98rem; color: var(--ink); }
.trio-item figcaption span { font-size: .88rem; color: var(--muted); }

/* ── Steps ────────────────────────────────────────────────────────────── */

.steps {
  counter-reset: step;
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1.5rem; grid-template-columns: 1fr;
}
@media (min-width: 52rem) { .steps { grid-template-columns: repeat(2, 1fr); gap: 1.75rem 2.5rem; } }
@media (min-width: 72rem) { .steps { grid-template-columns: repeat(4, 1fr); } }

.steps li { counter-increment: step; position: relative; padding-top: 2.9rem; }

/* Numbered because this is a sequence: step three only makes sense after two. */
.steps li::before {
  content: counter(step);
  position: absolute; top: 0; left: 0;
  display: grid; place-items: center;
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-family: var(--display); font-weight: 700; font-size: .95rem;
}

/* The dashed run between markers only reads as one line when the four steps
   sit in a single row; below that it would be four stubs. */
@media (min-width: 72rem) {
  .steps li::after {
    content: ""; position: absolute; top: 1.05rem; left: 2.6rem; right: -2.5rem;
    border-top: 1px dashed var(--brand-200);
  }
  .steps li:last-child::after { content: none; }
}

.steps p { margin-top: .5rem; font-size: .95rem; }

/* ── Comparison ───────────────────────────────────────────────────────── */

.bench-wrap { overflow-x: auto; }

.bench { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: .94rem; }
.bench th, .bench td { text-align: left; padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.bench thead th {
  font-family: var(--display); font-weight: 600; font-size: .95rem; color: var(--ink);
  border-bottom: 2px solid var(--brand-200); padding-bottom: .65rem;
}
.bench tbody th { font-family: var(--text); font-weight: 600; color: var(--ink); width: 12rem; }
.bench td { color: var(--body); }
.bench td.no { color: var(--muted); }
.bench tbody tr:last-child th, .bench tbody tr:last-child td { border-bottom: 0; }

/* ── Privacy list ─────────────────────────────────────────────────────── */

.ticks-lg li { padding-left: 1.8rem; font-size: .99rem; }
.ticks-lg li::before { top: .55em; width: .55rem; height: .55rem; opacity: .55; }

/* ── FAQ ──────────────────────────────────────────────────────────────── */

.faq { max-width: 52rem; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.15rem 0;
  font-family: var(--display); font-weight: 600; font-size: 1.05rem; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; margin-left: auto; margin-top: .3rem;
  width: .7rem; height: .7rem;
  border-right: 2px solid var(--brand); border-bottom: 2px solid var(--brand);
  transform: rotate(45deg); transition: transform .22s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq summary:hover { color: var(--brand-dark); }
.faq p { padding: 0 2rem 1.25rem 0; max-width: 46em; font-size: .99rem; }
