/* ==========================================================================
   SLP Express - the AI assistant's screens (M2B)
   Loaded after app.css and built only from its tokens (PART 1a) and components, so the draft
   card, the Telugu summary and the AI settings page look like the rest of the inbox. Phone first
   (390 px, iPhone Safari): 44 px tap targets, 16 px form text (no zoom), safe-area insets. No
   inline styles or scripts anywhere: the Content-Security-Policy forbids them.

   Chat     .draft-card (the AI's suggested reply above the reply bar) .chat-summary
   List     .convo__summary
   Reply    .translation-preview (the father's own words written for the customer)
   Settings .assistant-page .setting-card .setting-choice .intent-list .state-pill
   ========================================================================== */

/* ---- the AI's suggested reply, above the reply bar ---------------------------------------- */
.draft-card {
  margin: 12px 0 6px;
}

.draft-card__inner {
  display: grid;
  gap: 10px;
  padding: 12px 14px 14px;
  background: linear-gradient(180deg, #faf5fd 0%, var(--white) 100%);
  border: 1.5px solid #dccfe8;
  border-left: 5px solid var(--logo-purple);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}

.draft-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.draft-card__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--heading);
}

.draft-card__icon {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--logo-purple);
}

.draft-card__time {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--muted);
}

.draft-card__text {
  margin: 0;
  padding: 10px 12px;
  font-size: 1rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #fff2c2;
  border: 1px solid #f5d772;
  border-radius: 14px 4px 14px 14px;
}

.draft-card__meaning {
  padding: 10px 12px;
  background: var(--tint-purple);
  border-radius: var(--r-md);
}

.draft-card__label {
  display: block;
  margin-bottom: 2px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--secondary);
}

.draft-card__meaning p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.draft-card__note {
  margin: 0;
  padding: 8px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  color: #5c4300;
  background: var(--tint-gold);
  border-radius: var(--r-sm);
}

.draft-card__actions {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 8px;
}

.draft-card__actions form {
  margin: 0;
}

.draft-card__actions button {
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding-left: 8px;
  padding-right: 8px;
}

@media (max-width: 359px) {
  .draft-card__actions {
    grid-template-columns: 1fr 1fr;
  }
  .draft-card__actions form:first-child {
    grid-column: 1 / -1;
  }
}

/* ---- the summary in Telugu, in the strip under the chat head --------------------------------
   It sits inside the sticky "who replies" strip (.chat-state), two lines long; a tap opens the
   whole text (a <details> whose summary is the text itself), and the open text scrolls inside
   36 % of the screen, so the sticky strip never covers the chat. */
.chat-summary {
  margin: 0;
  background: var(--tint-purple);
  border-bottom: 1px solid #dccfe8;
}

.chat-summary__inner {
  display: block;
  padding: 6px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  list-style: none;
  cursor: pointer;
}

.chat-summary__inner::-webkit-details-marker {
  display: none;
}

.chat-summary__head {
  display: flex;
  align-items: baseline;
  gap: 4px 10px;
}

.chat-summary__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--secondary);
}

.chat-summary__time {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--muted);
}

.chat-summary__text {
  display: -webkit-box;
  margin-top: 1px;
  overflow: hidden;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.chat-summary[open] .chat-summary__text {
  display: block;
  max-height: 36vh;
  overflow-y: auto;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}

/* ---- the summary in the list -------------------------------------------------------------------- */
.convo__summary {
  display: -webkit-box;
  margin-top: 2px;
  overflow: hidden;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--secondary);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow-wrap: anywhere;
}

.convo__summary-time {
  margin-left: 4px;
  font-size: 0.72rem;
  color: var(--muted);
}

/* ---- the father's own words, written for the customer ---------------------------------------- */
.translation-preview {
  display: grid;
  gap: 10px;
}

.translation-preview__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--heading);
}

.translation-preview__error {
  margin: 0;
  padding: 8px 10px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--danger-ink);
  background: var(--tint-red);
  border-radius: var(--r-sm);
}

.translation-preview__own {
  margin: 0;
  padding: 10px 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--page-alt);
  border: 1px dashed var(--input-border);
  border-radius: var(--r-md);
}

.translation-preview__form {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.translation-preview__form button,
.translation-preview__form .button {
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding-left: 8px;
  padding-right: 8px;
}

.composer-tools {
  display: flex;
  margin: 6px 2px 0;
}

.composer-tools .button {
  min-height: 44px;
  margin: 0;
  font-size: 0.9rem;
}

/* ---- the AI settings page -------------------------------------------------------------------------- */
/* FX1 item p: the page's own width, as every admin page (no narrower column of its own). */
.assistant-page {
  display: grid;
  gap: 14px;
}

.assistant-page__facts {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--secondary);
  background: var(--tint-purple);
  border-radius: var(--r-md);
}

.assistant-page__facts p {
  margin: 0;
}

.setting-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
}

.setting-card__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--heading);
}

.setting-card__help {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.setting-card form {
  display: grid;
  gap: 10px;
  margin: 0;
}

.setting-card__error {
  margin: 0;
  padding: 8px 10px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--danger-ink);
  background: var(--tint-red);
  border-radius: var(--r-sm);
}

.state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 12px;
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: var(--r-pill);
}

.state-pill--on {
  color: var(--green-ink);
  background: var(--tint-green);
}

.state-pill--off {
  color: #5b4b6b;
  background: #e4dcec;
}

.setting-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 0;
  padding: 8px 12px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  background: var(--page);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
}

.setting-choice input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--secondary);
}

.setting-choice:has(input:checked) {
  background: var(--tint-purple);
  border-color: var(--logo-purple);
}

.setting-card select {
  min-height: 48px;
  font-size: 16px;
}

.setting-card button[type='submit'] {
  width: 100%;
  min-height: 46px;
  margin: 0;
}

@media (min-width: 720px) {
  .setting-card button[type='submit'] {
    width: auto;
    justify-self: start;
    min-width: 180px;
  }
}

/* ---- AI2: the stages, the kill switch, a suggestion's verdict, the customer's language ------------------------
   docs/AI2-UNDERSTANDING-AND-REPLIES-CONTRACT.md §2, §5. Plain CSS (strict CSP: no inline style). */
.setting-card--stage {
  border-color: var(--logo-purple);
  box-shadow: var(--shadow-card);
}

.stage-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.stage-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 12px;
  background: var(--page);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
}

.stage-option input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--secondary);
}

.stage-option:has(input:checked) {
  background: var(--tint-purple);
  border-color: var(--logo-purple);
}

.stage-option:has(input:focus-visible) {
  outline: 3px solid var(--gold-deep);
  outline-offset: 2px;
}

.stage-option__body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.stage-option__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--heading);
}

.stage-option__now {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 1px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--on-gold);
  background: var(--gold);
  border-radius: var(--r-pill);
}

.stage-option__text {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text);
}

.stage-option__needs {
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--muted);
}

.stage-option__status {
  justify-self: start;
  padding: 3px 10px;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.4;
  border-radius: var(--r-sm);
}

.stage-option__status--ready {
  color: var(--green-ink);
  background: var(--tint-green);
}

.stage-option__status--blocked {
  color: var(--orange-text);
  background: var(--tint-gold);
}

.stage-facts {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 10px 12px 10px 28px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
  background: var(--page);
  border-radius: var(--r-md);
}

.button.stop-button,
.button.handler__stop {
  color: var(--white);
  background: var(--danger);
  border-color: var(--danger);
  box-shadow: none;
}

.button.stop-button:hover,
.button.handler__stop:hover {
  color: var(--white);
  background: var(--danger-ink);
}

.button.stop-button {
  width: 100%;
  margin: 8px 0 0;
}

@media (min-width: 720px) {
  .button.stop-button {
    width: auto;
  }
}

.assistant-advanced {
  margin-top: 6px;
}

.assistant-advanced__title {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--page);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
}

.assistant-advanced__title::before {
  content: '▸';
  margin-right: 8px;
  font-size: 1.1rem;
}

.assistant-advanced[open] > .assistant-advanced__title::before {
  content: '▾';
}

.assistant-advanced[open] > .assistant-advanced__title {
  margin-bottom: 10px;
}

.assistant-advanced__body {
  display: grid;
  gap: 14px;
}

/* S9 of the AI2 review: while anything answers by itself, stopping is the first thing under the band. */
.stop-banner {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  background: var(--tint-red);
  border: 1.5px solid var(--danger);
  border-radius: var(--r-md);
}

.stop-banner__text {
  margin: 0;
  font-size: 0.93rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--danger-ink);
}

.stop-banner .button.stop-button {
  margin: 0;
}

@media (min-width: 720px) {
  .stop-banner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

/* The AI2 trial merge: the stop banner and a refused reason sit above UI3-0's band, outside .page, so they take the
   page's own side gutter and width (16 px; 32 px from 1024 px), never the screen's edge. */
.page-top {
  display: grid;
  gap: 8px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
}

@media (min-width: 1024px) {
  .page-top {
    padding: 16px 32px;
  }
}

/* N9: what only a technician needs, folded. */
.stage-details {
  font-size: 0.85rem;
  color: var(--muted);
}

.stage-details > summary {
  display: list-item;
  min-height: 44px;
  padding: 10px 0;
  line-height: 24px;
  font-weight: 700;
  cursor: pointer;
}

.stage-details p {
  margin: 4px 0 0;
  line-height: 1.45;
}

/* N9: a step whose checks fail cannot be chosen; its reason stays readable. */
.stage-option.is-disabled {
  cursor: not-allowed;
}

.stage-option.is-disabled .stage-option__name,
.stage-option.is-disabled .stage-option__text,
.stage-option.is-disabled .stage-option__needs {
  opacity: 0.7;
}

/* N9: "Stop all automatic replies" keeps 16 px from "Take over". */
.handler__actions:has(.handler__stop) {
  gap: 16px;
}

.stop-confirm__now {
  font-weight: 700;
}

.draft-card__verdict {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.draft-verdict {
  padding: 3px 10px;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.4;
  border-radius: var(--r-pill);
}

.draft-verdict--send {
  color: var(--green-ink);
  background: var(--tint-green);
}

.draft-verdict--hold {
  color: var(--orange-text);
  background: var(--tint-gold);
}

.draft-verdict--person {
  color: var(--primary);
  background: var(--tint-purple);
}

.info-card__writes {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--secondary);
}

/* ---- AI2 round 3 (SC1 of the AI2 screen test): the header pill and Home's card per stage ----------------------------
   "AI suggesting" (Suggest only: nothing is sent by itself) has no live dot; "AI replying to test phones" is live like
   "AI replying". */
.ai-pill--suggesting {
  color: var(--gold);
  background: rgba(255, 213, 79, 0.1);
  border: 1px solid rgba(255, 213, 79, 0.5);
}

.ai-pill--suggesting .live-dot {
  display: none;
}

.ai-pill--replying-test {
  color: #dcfce7;
  background: rgba(22, 163, 74, 0.22);
  border: 1px solid rgba(74, 222, 128, 0.55);
}

.ai-pill--replying-test .live-dot {
  background: #4ade80;
}

.ai-state__badge--suggesting {
  color: #5c4300;
  background: var(--tint-gold);
  box-shadow: inset 0 0 0 1px rgba(255, 179, 0, 0.5);
}

.ai-state__badge--replying-test {
  color: var(--green-ink);
  background: var(--tint-green);
  box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.4);
}

.ai-state__badge--replying-test .live-dot {
  background: var(--leaf);
}

@media (prefers-reduced-motion: no-preference) {
  .ai-pill--replying-test .live-dot::after,
  .ai-state__badge--replying-test .live-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    border-radius: 50%;
    animation: ui-live 2.4s ease-out infinite;
  }
}

/* AI2 round 3: a refused change's reason at the top of the AI settings page (SC3); the rupee rate's field (SC9). */
.page-error {
  margin: 0;
}

#rate input[type='text'] {
  max-width: 10rem;
  min-height: 48px;
  font-size: 16px;
}

.meter__usd {
  color: var(--muted);
  font-weight: 600;
}

/* The pill's short words on a phone's one-line strip ("AI: test phones"); the full words from 720 px. */
.ai-pill__short {
  display: none;
}

@media (max-width: 719px) {
  .ai-pill__full {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .ai-pill__short {
    display: inline;
  }
}

/* AI2 round 3 (SC6): the customer card's language tag is a sentence; it wraps instead of widening the card. */
.info-card__facts .tag {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* The one card rule (the architect, 20 Oct 22:20), for every card kind (ordinary, reminder, extra chip, tracking reply,
   Other's office chip): the bottom line stays one row when it fits (an ordinary card: four lines, about 113 px at
   390 px) and wraps to a second row when it does not (five lines at most, 145 px at most). It wraps only where the row
   runs out: no forced line break, and nothing on it shrinks. Nothing is ever cut or shortened: the label chip sizes to
   its words (no ellipsis on a card), and the next step, the reminder's two red parts, the extra chip and the read button
   keep their full size. Replaces the per-kind rules (chip and reminder cards, BS1's line break, the Other section's
   chip row of 20 Oct) and SI1 round 2's "a long label gives way". The chat page's own label chip is not on a card. */
.convo__foot {
  flex-wrap: wrap;
  row-gap: 0; /* the 44 px controls already keep 10 px clear above and below: a wrapped card is about 139 px (4 px: 144) */
}

.convo__foot .label-menu {
  flex: none;
  max-width: 100%;
}

/* A label wider than the whole row (a long name an owner gave it) breaks onto a second line inside the chip. */
.convo__foot .label-menu__button .tag {
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
}

/* The same rule on the card's first line: a long name gives way (an ellipsis), never the masked number ("••5756"),
   which stays whole (SI16: on 600bb68 a 45-letter name pushed it out of sight). */
.convo-list--cards .convo__who-line {
  display: flex;
  align-items: baseline;
  column-gap: 4px; /* the space between the name and the number (a flex box drops it); with its 2 px margin as before */
}

.convo-list--cards .convo__name {
  flex: 0 1 auto;
}

.convo-list--cards .convo__number {
  flex: none;
}

/* R1.1 item 6: the rate card that goes with the suggestion when it is sent. */
.draft-card__cards {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* R1.1 item 9: "Today" on the AI settings page (since midnight). */
.today-facts { margin: 0; padding-left: 1.1rem; display: grid; gap: 4px; }
.today-facts li { overflow-wrap: anywhere; line-height: 1.45; }

/* R1.1 item 19: Today's leads (the Home "Today" rows, with the first reply and the callback under the tags). */
.today-lead { grid-template-rows: auto auto auto auto; }
.today-lead .today-item__time { grid-row: 1 / span 4; align-self: start; }
.today-lead__state { grid-column: 2; font-size: 0.86rem; color: var(--muted); overflow-wrap: anywhere; }
.today-lead__state.is-late { color: var(--danger); font-weight: 700; }
.today-replies { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.today-replies li { overflow-wrap: anywhere; }
.today-replies .today-reply__text { margin: 6px 0; white-space: pre-wrap; }

/* ---- AIM1: the card "The AI model" -------------------------------------------------------------------------------
   docs/AIM1-AI-MODELS-CONTRACT.md §2, §3: the trial under way (or the last one that ended without a change), and the
   fold where a key is pasted. The code and the key are typed into boxes of the house's own size (16 px: a phone does
   not zoom into them). */
.setting-card--model .field {
  display: grid;
  gap: 4px;
  max-width: 34rem;
}

.setting-card--model .field input {
  min-height: 48px;
  font-size: 16px;
}

.setting-card--model .hint {
  margin: 0;
}

.model-trial {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  background: var(--tint-gold);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.model-trial--ended {
  background: var(--tint-purple);
}

.model-trial__what {
  margin: 0;
  color: var(--text);
}

/* The fold is the house's `details.more`; the older `.more` (a centred "show more" line) shares the name, so the
   fold says its own: read from the left, no gap above its line. */
.model-keys {
  padding-top: 0;
  text-align: left;
}

.model-keys__title {
  margin: 0;
  font-weight: 700;
  color: var(--heading);
}

.model-keys__list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.92rem;
}

.model-keys__new {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.model-keys__new legend {
  padding: 0 4px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

/* What only a new model needs is out of the way while a listed model's key is replaced (a browser that does not
   know :has shows it always, which costs nothing: the fields are simply left empty). */
.model-keys__form:not(:has(#key-for option[value='new']:checked)) .model-keys__new {
  display: none;
}

.model-keys > form,
.model-keys > p,
.model-keys > ul {
  margin-top: 10px;
}

.model-keys__forget {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* Lane 3 (22 Nov 2026): the AI Assistant page in the brand's royal purple and gold. Every rule is scoped to the AI's
   own pages (.assistant-page, .stop-confirm, .replies-page, .model-trial), never the shared shell. */
.assistant-page .setting-card {
  border-color: #e4d6ef;
  border-top: 3px solid var(--secondary, #6a0099);
}
.assistant-page .setting-card__title {
  color: var(--primary, #4a0072);
}
.assistant-page .setting-card__subtitle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 6px 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--secondary, #6a0099);
}
.assistant-page .setting-card__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 0;
}
.assistant-page .setting-card__links a:not(.button) {
  font-weight: 700;
  color: var(--secondary, #6a0099);
}
.state-pill--paused {
  color: #7a4a00;
  background: #fff1cc;
  border: 1px solid #ffd54f;
}
.state-pill--maker {
  color: #ffffff;
  background: var(--secondary, #6a0099);
}
.model-trial .live-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--gold-deep, #ffb300);
  box-shadow: 0 0 0 0 rgba(255, 179, 0, 0.6);
  animation: lane3-pulse 1.6s ease-out infinite;
}
@keyframes lane3-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 179, 0, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(255, 179, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 179, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .model-trial .live-dot { animation: none; }
}
/* The folded secondary cards: the title and the live On/Off pill in one tappable row (48px), the card inside. */
.assistant-page .setting-fold {
  border: 1px solid #e4d6ef;
  border-radius: var(--r-card);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.assistant-page .setting-fold--inner {
  box-shadow: none;
  background: #faf6fd;
}
.assistant-page .setting-fold__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 8px 14px;
  font-weight: 800;
  color: var(--primary, #4a0072);
  cursor: pointer;
  list-style: none;
}
.assistant-page .setting-fold__summary::-webkit-details-marker {
  display: none;
}
.assistant-page .setting-fold__summary::before {
  content: attr(data-title);
  flex: 1 1 auto;
}
.assistant-page .setting-fold__summary[data-pill]::after {
  content: attr(data-pill);
  flex: 0 0 auto;
  padding: 2px 12px;
  font-size: 0.85rem;
  border-radius: var(--r-pill);
  color: #5b4b6b;
  background: #e4dcec;
}
.assistant-page .setting-fold__summary[data-state="on"]::after {
  color: var(--green-ink);
  background: var(--tint-green);
}
.assistant-page .setting-fold[open] > .setting-fold__summary {
  border-bottom: 1px solid #e4d6ef;
}
.assistant-page .setting-fold > .setting-card {
  border: 0;
  box-shadow: none;
}
.assistant-page .setting-fold > .w2a-pilot__form {
  padding: 12px 14px 14px;
}
.assistant-page .unit-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary, #4a0072);
  background: #fff6d6;
  border: 1px solid #ffd54f;
  border-radius: var(--r-sm);
}
/* "Stop automatic replies now": a red tint while something answers by itself; Cancel is a full, 48px button. */
.stop-confirm--danger {
  border-color: #f2b8b5;
  border-top: 4px solid var(--danger, #b3261e);
}
.stop-confirm--danger .confirm-summary {
  background: var(--tint-red);
}
.stop-confirm__cancel {
  min-height: 48px;
}
/* Saved Replies: the cards in the brand's frame. */
.replies-page .card {
  border-top: 3px solid var(--secondary, #6a0099);
}
.replies-page .card h2 {
  color: var(--primary, #4a0072);
}

/* Wave B Lane 4 (Module 10): AI settings. "What the AI does now" and "Today" side by side on a desktop; every fold has
   its live pill AND a chevron (the chevron is a background: ::before holds the title, ::after the pill). */
.assistant-page .assistant-top-grid { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: stretch; }
.assistant-page .assistant-top-grid > .setting-card { margin: 0; min-width: 0; }
@media (min-width: 1024px) { .assistant-page .assistant-top-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.assistant-page .setting-fold__summary {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a0099' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}
.assistant-page .setting-fold[open] > .setting-fold__summary {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a0099' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 15l-6-6-6 6'/%3E%3C/svg%3E");
}
.assistant-page .setting-fold__summary[data-state="warn"]::after { color: #7a5b00; background: #fff6dc; }

/* Wave B Lane 4 (Module 12): /users. Each row ends in its last sign-in, right-aligned, and a quiet chevron (the whole row
   opens the person). */
.user-list .user-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.user-list .user-row .user-row__seen {
  grid-column: 2;
}
.user-list .user-row .user-row__chevron {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted, #8a7a96);
}
.user-list .user-row:hover .user-row__chevron,
.user-list .user-row:focus-visible .user-row__chevron {
  color: var(--secondary, #6a0099);
}
@media (min-width: 900px) {
  .user-list .user-row {
    grid-template-columns: auto minmax(0, 1fr) minmax(160px, auto) auto;
  }
  .user-list .user-row .user-row__seen {
    grid-column: 3;
    justify-items: end;
    text-align: right;
  }
  .user-list .user-row .user-row__chevron {
    grid-column: 4;
    grid-row: auto;
  }
}
/* Wave B Lane 4: /users/new. Organisation and Branch line up on their boxes (their labels differ in length). */
.form-grid .form-grid__cell--bottom {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
/* Wave B Lane 4: a user's page. The cards wear the site's light card head (no dark-purple bars); Reset password and
   Disable account are real buttons, Disable tinted as the danger it is. */
.user-card .card-body > .facts { margin: 0; }
.user-actions .user-action { margin: 0 0 10px; border: 0; padding: 0; }
.user-actions .user-action > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 14px;
  font-weight: 700;
  border-radius: var(--r-md, 10px);
  border: 1px solid #d9c6ea;
  background: #faf6fd;
  color: var(--primary, #4a0072);
  cursor: pointer;
  list-style: none;
}
.user-actions .user-action > summary::-webkit-details-marker { display: none; }
.user-actions .user-action > summary:hover { background: #f3ecf9; }
.user-actions .user-action--danger > summary {
  border-color: #f0b8b4;
  background: #fdecea;
  color: #8c1d18;
}
.user-actions .user-action--danger > summary:hover { background: #fbdcd8; }
.user-actions .user-action[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.user-actions .user-action > form {
  padding: 10px 12px 12px;
  border: 1px solid #e4d6ef;
  border-top: 0;
  border-radius: 0 0 var(--r-md, 10px) var(--r-md, 10px);
}
.user-actions .user-action--danger > form { border-color: #f0b8b4; }
/* Wave C lane 4 (Ram, 23 Nov 2026): "Delete account…" on a login's page: the danger card holds a lede, "Send a code to
   my WhatsApp" and the 6-digit code with its red button. */
.user-actions .user-action--delete > .user-delete__body {
  display: grid;
  gap: 10px;
  padding: 10px 12px 12px;
  border: 1px solid #f0b8b4;
  border-top: 0;
  border-radius: 0 0 var(--r-md, 10px) var(--r-md, 10px);
  background: #fffafa;
}
.user-actions .user-action--delete .user-delete__body > p { margin: 0; }
.user-actions .user-action--delete .user-delete__body > form { display: grid; gap: 6px; padding: 0; border: 0; }
.user-actions .user-action--delete .user-delete__send button { justify-self: start; }
.user-actions .user-action--delete input[name="code"] { max-width: 9rem; font-size: 1.1rem; letter-spacing: 0.2em; font-variant-numeric: tabular-nums; }
.user-actions .user-delete__sent { color: #1b5e20; font-weight: 600; }
.user-actions .user-delete__last-owner { margin: 4px 0 0; }
/* Wave C lane 4: right under an alert about an enquiry, its three actions in one row (wrapping on a phone): Call
   customer (purple), Open chat (outline), and a quiet red "Turn off notifications" pill (Wave C visual polish: at least
   40 px tall, an easy thumb target on a phone, never a thin underlined link). */
.alert-item__quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
}
.alert-item__quick .alert-quick__off {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(140, 29, 24, 0.35);
  background: #fff7f6;
  color: #8c1d18;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}
.alert-item__quick .alert-quick__off.is-muted { border-color: #d8d1e0; background: #f5f3f7; color: var(--muted, #6b6b6b); text-decoration: none; }
/* Wave B Lane 4: Alert Settings. A template's state stays on one line ("Not created yet" never wraps three times); the
   raw Meta template name is a small muted technical detail under the plain name. */
.nt-template .nt-template__state,
.nt-line__state,
.nt-side-fold__summary .badge {
  white-space: nowrap;
  flex: 0 0 auto;
}
.nt-template .nt-template__text { min-width: 0; display: grid; gap: 2px; }
.nt-template .nt-template__tech { font-size: 0.75rem; color: var(--muted, #6b6b6b); overflow-wrap: anywhere; }
.nt-template .nt-template__tech code { font-size: inherit; background: none; padding: 0; color: inherit; }
/* Wave B Lane 4: Integrations. The connections two across on a desktop, each card's way in an outline button at its
   foot, and the server details a chevroned fold. */
body.app .conn-list.conn-list--grid { max-width: none; grid-template-columns: minmax(0, 1fr); align-items: stretch; }
@media (min-width: 1024px) { body.app .conn-list.conn-list--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
body.app .conn-list--grid > .conn { display: flex; flex-direction: column; min-width: 0; }
body.app .conn-list--grid .conn__open { margin-top: auto; padding-top: 10px; }
body.app .conn-list--grid .conn__cta { min-height: 40px; display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px solid var(--secondary, #6a0099); color: var(--secondary, #6a0099); }
body.app .conn-list--grid .conn__cta:hover { background: #f3ecf9; }
body.app .conn-list--grid .conn__server > summary { list-style: none; gap: 6px; }
body.app .conn-list--grid .conn__server > summary::-webkit-details-marker { display: none; }
body.app .conn-list--grid .conn__server > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: 0 2px 3px 4px; }
body.app .conn-list--grid .conn__server[open] > summary::after { transform: rotate(-135deg); margin-bottom: -3px; }
/* Wave B Lane 4: WhatsApp Lines. The Main and Updates cards are the same height, their Save buttons on one line at the
   foot; the line's number is shown as people read it. */
@media (min-width: 769px) {
  .w2d-lines.w2d { align-items: stretch; }
}
.w2d-lines > .w2d-card { display: flex; flex-direction: column; }
.w2d-lines > .w2d-card > .card-body { flex: 1 1 auto; display: flex; flex-direction: column; }
.w2d-lines > .w2d-card .w2d-send { flex: 1 1 auto; display: flex; flex-direction: column; }
.w2d-lines > .w2d-card .w2d-send > button[type="submit"] { margin-top: auto; align-self: flex-start; min-height: 44px; }
.w2d-lines .w2d-line-number { margin: 0 0 10px; font-size: 1.15rem; font-weight: 800; letter-spacing: 0.02em; color: var(--primary, #4a0072); font-variant-numeric: tabular-nums; }
/* Wave B Lane 4: Phone Calls. The "Who rings" explanation is a right-hand side card on a desktop (the switch and the
   office ticks stay above the fold) and comes after the controls on a phone; "Add their mobile" is a real button. */
body.app .calls-page.calls-page--side { display: flex; flex-direction: column; gap: 18px; }
body.app .calls-page--side > #calls-rules { order: 10; }
@media (min-width: 1100px) {
  body.app .calls-page.calls-page--side {
    display: grid;
    max-width: 1240px;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    grid-auto-flow: row dense;
    align-items: start;
  }
  body.app .calls-page--side > section { grid-column: 1; }
  body.app .calls-page--side > #calls-rules { grid-column: 2; grid-row: 1 / span 6; order: 0; position: sticky; top: calc(var(--appbar-h, 56px) + 12px); }
}
body.app .calls-page--side .calls-phone > summary {
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--secondary, #6a0099);
  border-radius: var(--r-md, 10px);
  background: #fff;
  color: var(--secondary, #6a0099);
  list-style: none;
}
body.app .calls-page--side .calls-phone > summary::-webkit-details-marker { display: none; }
body.app .calls-page--side .calls-phone > summary:hover { background: #f3ecf9; }
body.app .calls-page--side .calls-phone[open] > summary { margin-bottom: 8px; }
/* Wave B Lane 4: System Health. "Right now" in balanced rows (two across, four on a wide screen), never a lone tile. */
body.app .system-now.system-now--balanced { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { body.app .system-now.system-now--balanced { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { body.app .system-now.system-now--balanced { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
body.app .system-now--balanced .system-now__line { min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
