/* App UI v3: components on top of Tailwind (CDN). Tokens and rationale: web/static/DESIGN.md */

/* ── Colour tokens: RGB triplets so Tailwind opacity modifiers work (bg-paper/95 etc.) ── */
:root {
  /* Light palette (default) */
  --paper-rgb: 243 239 230;  --paper: rgb(var(--paper-rgb));
  --card-rgb:  251 249 244;  --card:  rgb(var(--card-rgb));
  --sand-rgb:  232 225 210;  --sand:  rgb(var(--sand-rgb));
  --rule-rgb:  211 202 186;  --rule:  rgb(var(--rule-rgb));
  --ink-rgb:   25  23  20;   --ink:   rgb(var(--ink-rgb));
  --ink-2-rgb: 74  69  61;   --ink-2: rgb(var(--ink-2-rgb));
  --ink-3-rgb: 107 100 88;   --ink-3: rgb(var(--ink-3-rgb));
  --signal-rgb:     224 69 31;    --signal:     rgb(var(--signal-rgb));
  --signal-ink-rgb: 179 54 26;    --signal-ink: rgb(var(--signal-ink-rgb));
  --moss-rgb:  45  106 69;   --moss:  rgb(var(--moss-rgb));
  --ochre-rgb: 138 90  11;   --ochre: rgb(var(--ochre-rgb));
  --brick-rgb: 162 50  28;   --brick: rgb(var(--brick-rgb));

  color-scheme: light;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

/* ── Dark palette ── */
:root[data-theme="dark"] {
  --paper-rgb: 36  33  30;
  --card-rgb:  44  41  38;
  --sand-rgb:  54  50  46;
  --rule-rgb:  74  69  63;
  --ink-rgb:   241 236 226;
  --ink-2-rgb: 201 193 179;
  --ink-3-rgb: 170 161 146;
  --signal-rgb:     232 92  55;
  --signal-ink-rgb: 240 138 102;
  --moss-rgb:  124 197 150;
  --ochre-rgb: 217 164 65;
  --brick-rgb: 232 115 90;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper-rgb: 36  33  30;
    --card-rgb:  44  41  38;
    --sand-rgb:  54  50  46;
    --rule-rgb:  74  69  63;
    --ink-rgb:   241 236 226;
    --ink-2-rgb: 201 193 179;
    --ink-3-rgb: 170 161 146;
    --signal-rgb:     232 92  55;
    --signal-ink-rgb: 240 138 102;
    --moss-rgb:  124 197 150;
    --ochre-rgb: 217 164 65;
    --brick-rgb: 232 115 90;
    color-scheme: dark;
  }
}
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; -webkit-text-size-adjust: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); font-feature-settings: "ss01", "cv11"; }
::selection { background: var(--signal); color: #fff; }

/* Display type */
.display { font-family: var(--serif); font-weight: 400; letter-spacing: -0.012em; line-height: 1.02; }
.display em, .display i { font-style: italic; }
.mono { font-family: var(--mono); }
.eyebrow { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 0.6rem; }
.eyebrow::before { content: ""; width: 1.25rem; height: 1px; background: var(--signal); }
.eyebrow.plain::before { display: none; }
.measure { max-width: 34rem; }
.lede { font-size: 1.125rem; line-height: 1.6; color: var(--ink-2); }

/* Links */
.lnk { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); transition: text-decoration-color .15s, text-decoration-thickness .15s; }
.lnk:hover { text-decoration-color: var(--signal); text-decoration-thickness: 2px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; min-height: 2.875rem;
  padding: 0.7rem 1.15rem; border-radius: 3px; background: var(--ink); color: var(--paper); font-weight: 500;
  border: 1px solid var(--ink); transition: background .15s, color .15s, border-color .15s; text-decoration: none; cursor: pointer; }
.btn:hover { background: color-mix(in srgb, var(--ink) 85%, transparent); }
.btn .arr { transition: transform .18s ease; }
.btn:hover .arr { transform: translateX(3px); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-quiet:hover { background: var(--ink); color: var(--paper); }
.btn-signal { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn-signal:hover { background: color-mix(in srgb, var(--signal) 82%, black); }
.btn-small { min-height: 2.5rem; padding: 0.45rem 0.85rem; font-size: 0.875rem; }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn[aria-busy="true"] { cursor: progress; }

/* Phones: every control you tap is at least 44px tall. Inline links keep their line box and get an
   invisible hit area, so paragraphs and tables do not reflow. */
@media (max-width: 639px) {
  .btn-small { min-height: 2.75rem; }
  .tap-target { min-height: 2.75rem; }
  .lnk, .pg-link { position: relative; }
  .lnk::after, .pg-link::after { content: ""; position: absolute; inset-block: -0.85rem; inset-inline: -0.25rem; }
  summary:not(.btn) { min-height: 2.75rem; padding-block: 0.55rem; }
}

/* Surfaces */
.sheet { background: var(--card); border: 1px solid var(--rule); border-radius: 3px; }
.sheet-lift { box-shadow: 0 1px 0 rgba(var(--ink-rgb) / .04), 0 24px 48px -28px rgba(var(--ink-rgb) / .35); }
.panel { background: var(--sand); border-radius: 3px; }
.rule-t { border-top: 1px solid var(--rule); }
.rule-b { border-bottom: 1px solid var(--rule); }
.ink-section { background: var(--ink); color: var(--paper); }
.ink-section .eyebrow { color: color-mix(in srgb, var(--paper) 75%, transparent); }
.ink-section .lnk { color: var(--paper); }
/* In dark mode, --ink is cream (#F1ECE2). Ink-section would become a glaring cream band.
   Override to a warm charcoal that sits just below --paper so it still reads as "accent/close" */
:root[data-theme="dark"] .ink-section { background: #1C1A17; color: var(--ink); }
:root[data-theme="dark"] .ink-section .eyebrow { color: var(--ink-3); }
:root[data-theme="dark"] .ink-section .lnk { color: var(--ink); }
:root[data-theme="dark"] .ink-section .text-ink-2,
:root[data-theme="dark"] .ink-section .text-ink-3 { color: var(--ink-2); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ink-section { background: #1C1A17; color: var(--ink); }
  :root:not([data-theme="light"]) .ink-section .eyebrow { color: var(--ink-3); }
  :root:not([data-theme="light"]) .ink-section .lnk { color: var(--ink); }
  :root:not([data-theme="light"]) .ink-section .text-ink-2,
  :root:not([data-theme="light"]) .ink-section .text-ink-3 { color: var(--ink-2); }
}

/* Status chips: text + dot, never colour alone */
.chip { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--mono); font-size: 0.6875rem;
  letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; padding: 0.2rem 0.5rem; border-radius: 2px;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink-2); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.chip.is-sent::before { background: var(--ink); }
.chip.is-wait { color: var(--ochre); border-color: color-mix(in srgb, var(--ochre) 45%, var(--rule)); } .chip.is-wait::before { background: var(--ochre); }
.chip.is-reply { color: var(--moss); border-color: color-mix(in srgb, var(--moss) 45%, var(--rule)); } .chip.is-reply::before { background: var(--moss); }
.chip.is-bad { color: var(--brick); border-color: color-mix(in srgb, var(--brick) 45%, var(--rule)); } .chip.is-bad::before { background: var(--brick); }
.chip.is-on::before { background: var(--signal); }

/* Forms */
.label { display: block; font-weight: 500; font-size: 0.9375rem; color: var(--ink); }
.label .opt { font-weight: 400; color: var(--ink-3); margin-left: 0.35rem; }
.help { margin-top: 0.4rem; font-size: 0.8125rem; line-height: 1.5; color: var(--ink-3); }
.err { margin-top: 0.4rem; font-size: 0.875rem; color: var(--brick); font-weight: 500; }
.field { display: block; width: 100%; margin-top: 0.5rem; padding: 0.7rem 0.8rem; font-size: 1rem; line-height: 1.45;
  background: var(--card); color: var(--ink); border: 1px solid var(--rule); border-radius: 3px; transition: border-color .15s; }
.field::placeholder { color: var(--ink-3); }
.field:hover { border-color: color-mix(in srgb, var(--ink) 35%, var(--rule)); }
.field:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.field[aria-invalid="true"] { border-color: var(--brick); }
textarea.field { resize: vertical; }
.choice { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.85rem 0.95rem; border: 1px solid var(--rule);
  border-radius: 3px; background: var(--card); cursor: pointer; transition: border-color .15s, background .15s; }
.choice:hover { border-color: color-mix(in srgb, var(--ink) 35%, var(--rule)); }
.choice:has(input:checked) { border-color: var(--ink); background: var(--card); box-shadow: inset 3px 0 0 var(--signal); }
input[type=checkbox], input[type=radio] { accent-color: var(--ink); width: 1.05rem; height: 1.05rem; margin-top: 0.15rem; flex-shrink: 0; }
input[type=range] { accent-color: var(--ink); width: 100%; }

/* Focus */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.ink-section :focus-visible { outline-color: var(--paper); }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 60; padding: 0.6rem 1rem; background: var(--ink); color: var(--paper); border-radius: 3px; }
.skip-link:focus { top: 1rem; }

/* Header nav: current page */
.nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--signal);
  text-decoration-thickness: 2px; text-underline-offset: 0.45em; }
.langs a[aria-current="true"] { color: var(--ink); font-weight: 600; }

/* details / accordions */
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
.chev { transition: transform .18s ease; }
details[open] > summary .chev { transform: rotate(45deg); }
.qa summary:hover .q { text-decoration: underline; text-decoration-color: var(--signal); text-underline-offset: 0.25em; }

/* Email sheet (product visual) */
.mail-meta { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-3); }
.hook { background: linear-gradient(transparent 58%, rgba(var(--signal-rgb) / .22) 58%); padding: 0 0.1em; }
.caret::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 1px; vertical-align: -0.15em;
  background: var(--signal); animation: blink 1.05s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

/* Tabs */
.tab { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.6rem 0.2rem;
  border-bottom: 2px solid transparent; color: var(--ink-3); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--signal); }
.tab:hover { color: var(--ink); }

/* Legal / long text */
.prose-legal h2 { margin-top: 2.75rem; font-family: var(--serif); font-size: 1.75rem; line-height: 1.15; }
.prose-legal h3 { margin-top: 1.5rem; font-weight: 600; }
.prose-legal p, .prose-legal ul, .prose-legal ol { margin-top: 0.8rem; line-height: 1.7; color: var(--ink-2); }
.prose-legal ul { list-style: disc; padding-left: 1.2rem; } .prose-legal ol { list-style: decimal; padding-left: 1.2rem; }
.prose-legal li + li { margin-top: 0.35rem; }
.prose-legal nav ol { list-style: none; padding-left: 0; margin-top: 0.75rem; }
.prose-legal a { text-decoration: underline; text-underline-offset: 0.2em; }
.prose-legal b, .prose-legal strong { color: var(--ink); font-weight: 600; }
.todo { background: color-mix(in srgb, var(--ochre) 20%, var(--card)); color: var(--ochre); font-weight: 600; padding: 0 0.25rem; border-radius: 2px; }

/* Onboarding step list */
.step-link.is-current { color: var(--ink); }
.step-link.is-current .step-num { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.dropzone.is-dragover { border-color: var(--ink); background: var(--card); }

/* Coach gauge */
.gauge-track { stroke: var(--sand); }

/* iOS: never zoom into fields */
@media (max-width: 639px) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px !important; }
}

/* The hidden attribute wins over display utilities */
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Setup: form / conversation choice */
.mode { background: var(--paper); transition: background .15s, color .15s; }
.mode:hover { background: var(--card); }
.mode[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.mode[aria-checked="true"] .text-ink-3 { color: color-mix(in srgb, var(--paper) 75%, transparent); }
:root[data-theme="dark"] .mode[aria-checked="true"] { background: var(--sand); color: var(--ink); }
:root[data-theme="dark"] .mode[aria-checked="true"] .text-ink-3 { color: var(--ink-3); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mode[aria-checked="true"] { background: var(--sand); color: var(--ink); }
  :root:not([data-theme="light"]) .mode[aria-checked="true"] .text-ink-3 { color: var(--ink-3); }
}

/* Intake conversation: reads like a letter exchange, not a chat bubble widget */
.intake-ai { max-width: 92%; padding-left: 0.9rem; border-left: 2px solid var(--signal); white-space: pre-line; }
.intake-me { margin-left: auto; max-width: 85%; padding: 0.55rem 0.8rem; background: var(--sand); white-space: pre-line; }
.intake-typing span { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--ink-3);
  animation: intake-dot 1.1s ease-in-out infinite; }
.intake-typing span:nth-child(2) { animation-delay: .15s; } .intake-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes intake-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.intake-row button:hover { text-decoration: underline; text-decoration-color: var(--signal); text-underline-offset: 0.2em; }

/* Checkout confirmation: the summary behaves like a button, the panel opens under it */
details.buy > summary { list-style: none; }
details.buy[open] > summary { background: var(--ink); color: var(--paper); }
:root[data-theme="dark"] details.buy[open] > summary { background: #1C1A17; color: var(--ink); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) details.buy[open] > summary { background: #1C1A17; color: var(--ink); }
}

/* Home (v6): beta target as 100 squares, comparison table that stacks on phones */
.dotgrid { display: grid; grid-template-columns: repeat(10, 0.6rem); gap: 0.22rem; }
.dotgrid > span { width: 0.6rem; height: 0.6rem; border: 1px solid var(--rule); border-radius: 1px; }
.dotgrid > span.is-reply { background: var(--moss); border-color: var(--moss); }
@media (min-width: 640px) { .dotgrid { grid-template-columns: repeat(10, 0.75rem); gap: 0.25rem; } .dotgrid > span { width: 0.75rem; height: 0.75rem; } }
.compare tbody tr { border-top: 1px solid var(--rule); }
.compare tbody tr.is-us { border-top: 1px solid var(--ink); background: var(--card); box-shadow: inset 3px 0 0 var(--signal); }
.compare tbody tr.is-us th { padding-left: 0.75rem; }
@media (max-width: 639px) {
  .compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .compare tbody tr { display: block; padding: 0.75rem 0; }
  .compare tbody tr.is-us { padding: 0.75rem; }
  .compare th, .compare td { display: block; padding: 0.15rem 0 !important; }
  .compare td::before { content: attr(data-label) " · "; font-family: var(--mono); font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
}
.ink-section .text-ink-2, .ink-section .text-ink-3 { color: color-mix(in srgb, var(--paper) 75%, transparent); }

/* Guided onboarding (guide.html): step rail + a conversation that reads like a person writing, not a widget */
.guide-rail { border-top: 1px solid var(--ink); }
.guide-rail li { display: grid; grid-template-columns: 1.75rem 1fr auto; align-items: baseline; gap: 0.5rem;
  padding: 0.7rem 0; border-bottom: 1px solid var(--rule); color: var(--ink-3); }
.guide-rail .num { font-size: 0.75rem; }
.guide-rail .st { font-size: 0.6875rem; letter-spacing: 0.05em; text-transform: uppercase; }
.guide-rail li.is-done { color: var(--ink-2); }
.guide-rail li.is-done .num { color: var(--moss); }
.guide-rail li.is-done .name { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-3) 50%, transparent); }
.guide-rail li.is-current { color: var(--ink); font-weight: 500; box-shadow: inset 3px 0 0 var(--signal); padding-left: 0.75rem; }
.guide-rail li.is-current .num, .guide-rail li.is-current .st { color: var(--signal-ink); }
@media (max-width: 1023px) {
  .guide-rail { display: flex; gap: 0.25rem; border-top: 0; overflow-x: auto; }
  .guide-rail li { flex: 1 0 auto; grid-template-columns: auto; gap: 0.15rem; padding: 0.4rem 0.5rem 0.5rem; border-bottom: 2px solid var(--rule); }
  .guide-rail li .name, .guide-rail li .st { font-size: 0.75rem; white-space: nowrap; }
  .guide-rail li:not(.is-current) .name, .guide-rail li .st { display: none; }
  .guide-rail li.is-done { border-bottom-color: var(--moss); }
  .guide-rail li.is-current { box-shadow: none; padding-left: 0.5rem; border-bottom-color: var(--signal); }
  .guide-rail li.is-done .name { text-decoration: none; }
}
.guide-mark { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--ink); color: var(--paper); font-family: var(--serif); font-size: 1.25rem; line-height: 1; }
:root[data-theme="dark"] .guide-mark { background: var(--sand); color: var(--ink); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .guide-mark { background: var(--sand); color: var(--ink); }
}
.guide-msg { max-width: 38rem; }
.guide-msg .who { font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.3rem; }
.guide-msg .say { font-size: 1.0625rem; line-height: 1.6; color: var(--ink); }
.guide-msg .say + .say { margin-top: 0.6rem; }
.guide-msg.is-mine { margin-left: auto; padding: 0.6rem 0.8rem; background: var(--sand); border-radius: 3px; max-width: 30rem; }
.guide-msg.is-mine .say { font-size: 1rem; color: var(--ink-2); }
.guide-msg.is-typing { display: flex; gap: 0.3rem; padding: 0.4rem 0; }
.guide-msg.is-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: guide-dot 1s infinite ease-in-out; }
.guide-msg.is-typing span:nth-child(2) { animation-delay: .15s; } .guide-msg.is-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes guide-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .guide-msg.is-typing span { animation: none; opacity: .6; } }

/* Support launcher: smaller on phones, out of the way while typing (product/ux-audit.md §4.12) */
@media (max-width: 639px) {
  .support-launcher { bottom: 0.75rem; right: 0.75rem; min-height: 2.75rem; padding: 0.4rem 0.7rem; font-size: 0.8125rem; box-shadow: 3px 3px 0 0 var(--ink); }
  .support-launcher.is-away { transform: translateY(160%); pointer-events: none; }
}
.support-launcher { transition: transform .2s ease; }

/* Owner dashboard (admin.html + admin.js) */
.kpis .kpi { padding: 1.25rem 1rem 1.25rem 0; border-top: 1px solid var(--rule); }
.kpis .kpi.is-margin dd { color: var(--moss); }
.funnel-step { display: grid; grid-template-columns: 9.5rem 1fr 6.5rem; align-items: center; gap: 0.75rem; padding: 0.55rem 0; border-bottom: 1px solid var(--rule); font-size: 0.9375rem; }
.funnel-step .bar { height: 0.85rem; background: var(--sand); border-radius: 1px; overflow: hidden; }
.funnel-step .bar > span { display: block; height: 100%; background: var(--ink); }
.funnel-step:last-child .bar > span { background: var(--signal); }
.funnel-step .val { text-align: right; font-size: 0.8125rem; }
@media (max-width: 639px) { .funnel-step { grid-template-columns: 1fr auto; } .funnel-step .bar { grid-column: 1 / -1; grid-row: 2; } }
.months-chart { width: 100%; height: auto; display: block; }
.months-chart .grid { stroke: var(--rule); stroke-width: 1; }
.months-chart .axis { font-family: var(--mono); font-size: 10px; fill: var(--ink-3); }
.months-chart .rev, .months-legend .key.rev { fill: var(--moss); background: var(--moss); }
.months-chart .c-ai, .months-legend .key.c-ai { fill: var(--ink); background: var(--ink); }
.months-chart .c-contacts, .months-legend .key.c-contacts { fill: var(--ochre); background: var(--ochre); }
.months-chart .c-other, .months-legend .key.c-other { fill: var(--rule); background: var(--rule); }
.months-legend .key { display: inline-block; width: 0.65rem; height: 0.65rem; border-radius: 1px; }
.admin-users th[aria-sort="ascending"] button::after { content: " ↑"; }
.admin-users th[aria-sort="descending"] button::after { content: " ↓"; }
.admin-users tr.is-suspended td { color: var(--ink-3); }
.admin-detail { width: min(56rem, 100vw); max-width: 100vw; max-height: 100dvh; margin: 0 0 0 auto; height: 100dvh; padding: 0;
  border: 0; border-left: 1px solid var(--ink); background: var(--card); color: var(--ink); display: none; flex-direction: column; }
.admin-detail[open] { display: flex; }
.admin-detail::backdrop { background: rgba(var(--ink-rgb) / .35); }
.admin-act { padding: 0.9rem; border: 1px solid var(--rule); border-radius: 3px; background: var(--paper); }
.btn-danger { background: var(--brick); border-color: var(--brick); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--brick) 80%, black); }

/* Wordmark: the product name as text (no logo yet), always from app_name */
.wordmark { letter-spacing: -0.02em; }

/* Shared motion layer (web/static/motion.js). Everything below only applies once JS has
   marked <html> with .js-motion; motion.js never does that under prefers-reduced-motion.
   No-JS visitors therefore see every element in its final state. Calm, eased, small moves. */
.js-motion [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity .55s cubic-bezier(.22,.61,.36,1) var(--reveal-delay, 0ms),
              transform .55s cubic-bezier(.22,.61,.36,1) var(--reveal-delay, 0ms);
}
.js-motion [data-reveal="fade"] { transform: none; }
.js-motion [data-reveal="left"] { transform: translate3d(-16px, 0, 0); }
.js-motion [data-reveal].is-visible { opacity: 1; transform: none; }

/* Sequence: all steps stay readable; the current one is marked in turn. */
.js-motion [data-sequence] [data-step] {
  opacity: .58;
  transition: opacity .4s cubic-bezier(.22,.61,.36,1), transform .4s cubic-bezier(.22,.61,.36,1);
}
.js-motion [data-sequence] [data-step].is-current {
  opacity: 1;
  transform: translate3d(0, -2px, 0);
  box-shadow: inset 3px 0 0 var(--signal);
}
.motion-progress { height: 2px; margin-top: 1rem; background: var(--rule); overflow: hidden; }
.motion-progress__fill { display: block; height: 100%; background: var(--signal);
  transform: scaleX(0); transform-origin: left center; }
.js-motion [data-typewrite].is-typing::after {
  content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px;
  vertical-align: -0.12em; background: var(--signal);
  animation: motion-caret 1.05s steps(2, start) infinite;
}
@keyframes motion-caret { to { visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  .js-motion [data-reveal], .js-motion [data-sequence] [data-step] {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
  .js-motion [data-typewrite].is-typing::after { animation: none !important; }
}

/* Guide journey checklist: the 8-step path, stateful and animated */
.journey { border-top: 1px solid var(--ink); }
.journey-step { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; align-items: start; gap: 0.35rem 0.75rem;
  padding: 0.85rem 0; border-bottom: 1px solid var(--rule); color: var(--ink-3); }
.journey-mark { font-family: var(--mono); font-size: 0.8125rem; line-height: 1.5; color: var(--ink-3); }
.journey-name { font-weight: 500; color: var(--ink-2); line-height: 1.35; }
.journey-help { margin-top: 0.2rem; font-size: 0.875rem; line-height: 1.5; color: var(--ink-3); }
.journey-cta { align-self: center; justify-self: end; white-space: nowrap; }
.journey-step.is-done { color: var(--ink-2); }
.journey-step.is-done .journey-mark { color: var(--moss); font-weight: 600; }
.journey-step.is-done .journey-name { color: var(--ink-2); }
.journey-step.is-current { color: var(--ink); box-shadow: inset 3px 0 0 var(--signal); padding-left: 0.75rem; margin-left: -0.75rem; }
.journey-step.is-current .journey-mark,
.journey-step.is-current .journey-name { color: var(--ink); }
.journey-step.is-current .journey-mark { color: var(--signal-ink); font-weight: 600; }
.journey-step.is-todo .journey-cta { opacity: 0.85; }
@media (max-width: 639px) {
  .journey-step { grid-template-columns: 1.75rem minmax(0, 1fr); }
  .journey-cta { grid-column: 2; justify-self: start; margin-top: 0.35rem; }
}

/* Dashboard review: Step A choose contacts, Step B review mails */
.review-pick { transition: opacity .2s cubic-bezier(.22,.61,.36,1), background-color .2s ease; }
.review-pick:has(input[type="checkbox"]:not(:checked)),
.review-pick.is-off { opacity: .45; }
.review-pick:has(input[type="checkbox"]:not(:checked)) .font-medium,
.review-pick.is-off .font-medium { text-decoration: line-through; text-decoration-color: var(--ink-3); }
.review-mail { transition: opacity .25s ease, transform .25s ease; }
.js-motion .review-mail.is-entering { animation: frame-in .32s cubic-bezier(.22,.61,.36,1) both; }
@media (prefers-reduced-motion: reduce) {
  .review-pick, .review-mail { transition: none !important; }
}
