/* =====================================================================
 * Yanyja — Channel Orchestration F1
 *
 * The user-visible layer for feature 004: per-message delivery status +
 * channel marks in the Booking Feed, SMS consent capture in the booking
 * flow, the "reminder not delivered" at-risk flag on the day board, the
 * quiet-hours / channel-policy panel in settings, and the no-login
 * per-salon opt-out landing page.
 *
 * Import order (after the brand layer, before page styles):
 *   1. yarra-colors-and-type.css
 *   2. yarra-tokens.css
 *   3. yanyja-tokens.css
 *   4. yanyja-mobile.css   (where the mobile contract is used)
 *   5. yanyja-channels.css ← this file
 *
 * Principle VIII — delivery honesty. A message's true state is shown
 * plainly: `delivered` reads quietly reassuring; `failed` is honest and
 * legible, never softened into a fake "sent". Status is NEVER colour-only
 * — every badge pairs a StatusDot colour with a text label.
 *
 * Status → token map (single source of truth):
 *   delivered           → --status-success (moss)
 *   read                → --status-success, subtler ground
 *   sent / queued       → --status-info / --fg-muted (in-flight, not a promise)
 *   failed              → --status-danger (EMPHASISED)
 *   channel-unavailable → --fg-tertiary (neutral, "not opted in")
 * =================================================================== */

/* =====================================================================
 * B · DELIVERY STATUS + CHANNEL MARK  (Booking Feed)
 *   Built from a StatusDot + an Eyebrow-style label, not a bespoke chip.
 *   .yj-msg-meta is the row that sits under an outbound feed message.
 * =================================================================== */
.yj-msg-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 6px;
}

/* ---- channel mark (email / sms / in-app / push) ---- */
.yj-channel {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
}
.yj-channel svg {
  width: 13px;
  height: 13px;
  stroke-width: 1.7;
  flex-shrink: 0;
}

/* ---- delivery status badge ---- */
.yj-delivery {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 3px 9px 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.yj-delivery__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}
.yj-delivery time {
  font-size: 9px;
  letter-spacing: 0.04em;
  opacity: 0.72;
  text-transform: none;
}

/* in-flight: queued — the quietest, not yet a promise */
.yj-delivery[data-status="queued"] {
  color: var(--fg-muted);
  background: var(--bg-sunken);
  border-color: var(--border-subtle);
}
.yj-delivery[data-status="queued"] .yj-delivery__dot {
  background: var(--fg-muted);
  animation: yj-pulse-soft 1600ms ease-in-out infinite;
}

/* in-flight: sent — canopy info, handed to the carrier */
.yj-delivery[data-status="sent"] {
  color: var(--status-info);
  background: var(--status-info-bg);
  border-color: color-mix(in oklab, var(--status-info) 22%, transparent);
}

/* delivered — quietly reassuring moss */
.yj-delivery[data-status="delivered"] {
  color: var(--status-success);
  background: var(--status-success-bg);
  border-color: color-mix(in oklab, var(--status-success) 24%, transparent);
}

/* read — success, subtler ground (open dot, no fill weight) */
.yj-delivery[data-status="read"] {
  color: var(--moss-600);
  background: transparent;
  border-color: color-mix(in oklab, var(--status-success) 30%, transparent);
}

/* failed — honest and emphasised */
.yj-delivery[data-status="failed"] {
  color: var(--status-danger);
  background: var(--status-danger-bg);
  border-color: color-mix(in oklab, var(--status-danger) 32%, transparent);
  font-weight: 600;
}

/* channel-unavailable — neutral, never alarming */
.yj-delivery[data-status="unavailable"] {
  color: var(--fg-tertiary);
  background: transparent;
  border-color: var(--border-default);
  border-style: dashed;
}

/* status change settles in place (reduced-motion safe below) */
.yj-delivery {
  transition: background var(--duration-base, 220ms) var(--ease-out, ease),
              color var(--duration-base, 220ms) var(--ease-out, ease);
}
.yj-delivery.yj-just-changed {
  animation: yj-fade-in-up var(--duration-base, 220ms) var(--ease-out, ease);
}

/* =====================================================================
 * B5 · FAILED — the hero treatment.
 *   A failed reminder is the signal that saves a booking, so it reads as
 *   actionable, not as a buried log line: danger left-rail, tinted ground,
 *   plain-language reason, and a provider action that ties to the day-board
 *   at-risk flag (C). No auto-retry UI in F1.
 * =================================================================== */
.yj-failbox {
  margin-top: 8px;
  display: flex;
  gap: 11px;
  padding: 12px 14px;
  background: var(--status-danger-bg);
  border: 1px solid color-mix(in oklab, var(--status-danger) 26%, transparent);
  border-left: 3px solid var(--status-danger);
  border-radius: 10px;
}
.yj-failbox__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in oklab, var(--status-danger) 14%, transparent);
  color: var(--status-danger);
}
.yj-failbox__icon svg { width: 16px; height: 16px; stroke-width: 1.9; }
.yj-failbox__body { flex: 1; min-width: 0; }
.yj-failbox__title {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.2;
  color: var(--status-danger);
  margin: 0 0 3px;
}
.yj-failbox__reason {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--mist-700);
  margin: 0 0 9px;
}
.yj-failbox__reason b { font-weight: 500; color: var(--status-danger); }
.yj-failbox__acts { display: flex; flex-wrap: wrap; gap: 8px; }
.yj-failbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
}
.yj-failbtn svg { width: 14px; height: 14px; stroke-width: 1.9; }
.yj-failbtn--primary { background: var(--status-danger); color: #fff; }
.yj-failbtn--primary:hover { background: color-mix(in oklab, var(--status-danger) 85%, #000); }
.yj-failbtn--ghost { background: transparent; color: var(--status-danger); border-color: color-mix(in oklab, var(--status-danger) 32%, transparent); }
.yj-failbtn--ghost:hover { background: color-mix(in oklab, var(--status-danger) 9%, transparent); }

/* On mobile feed bubbles the meta + failbox align under the bubble */
.feed-msg .yj-msg-meta { margin-left: 2px; }

/* A notification "send" log line in the desktop feed — reads as an event,
   not a chat bubble; overrides the system-event dashed wrap. */
.feed-sys.feed-send {
  font-style: normal;
  border: 0 !important;
  padding: 2px 0 !important;
  margin: 0 !important;
  color: var(--fg-secondary);
  line-height: 1.45;
}

/* =====================================================================
 * A · SMS CONSENT CAPTURE  (booking flow)
 *   A phone field + a single real, focusable opt-in checkbox with
 *   compliant helper copy. Per-salon. NEVER pre-ticked.
 * =================================================================== */
.yj-consent {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg, 14px);
  background: var(--bg-surface);
  padding: 18px;
}
.yj-consent__eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
}
.yj-consent__eyebrow svg { width: 14px; height: 14px; stroke-width: 1.7; color: var(--fg-accent); }

.yj-consent__field { margin-bottom: 14px; }
.yj-consent__field > label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg-secondary);
  margin-bottom: 6px;
}
.yj-phone {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-default);
  border-radius: 11px;
  background: var(--bg-surface);
  overflow: hidden;
  transition: border-color 120ms, box-shadow 120ms;
}
.yj-phone:focus-within { border-color: var(--canopy-400); box-shadow: var(--ring-focus); }
.yj-phone__cc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  align-self: stretch;
  background: var(--bg-sunken);
  border-right: 1px solid var(--border-default);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-secondary);
  white-space: nowrap;
}
.yj-phone input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  border: 0;
  background: transparent;
  outline: none;
  padding: 0 13px;
  font-size: 16px;
  font-family: inherit;
  color: var(--fg-primary);
  letter-spacing: 0.02em;
}

/* the opt-in row — the whole row is the >=44px target/label */
.yj-optin {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--bg-page);
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
}
.yj-optin:hover { border-color: var(--border-strong); }
.yj-optin:focus-within { border-color: var(--canopy-400); box-shadow: var(--ring-focus); }
.yj-optin[data-checked="true"] {
  border-color: color-mix(in oklab, var(--moss-400) 55%, transparent);
  background: var(--moss-50);
}
.yj-optin__box {
  flex-shrink: 0;
  margin-top: 1px;
  width: 22px;
  height: 22px;
  border: 1.6px solid var(--border-strong);
  border-radius: 6px;
  background: var(--bg-surface);
  display: grid;
  place-items: center;
  color: transparent;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.yj-optin__box svg { width: 14px; height: 14px; stroke-width: 2.4; }
.yj-optin input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.yj-optin[data-checked="true"] .yj-optin__box {
  background: var(--moss-500);
  border-color: var(--moss-500);
  color: #fff;
}
/* CSS-only fallback (used where no JS drives data-checked, e.g. the modal) */
.yj-optin:has(input:checked) {
  border-color: color-mix(in oklab, var(--moss-400) 55%, transparent);
  background: var(--moss-50);
}
.yj-optin:has(input:checked) .yj-optin__box {
  background: var(--moss-500);
  border-color: var(--moss-500);
  color: #fff;
}
.yj-optin__text { flex: 1; min-width: 0; }
.yj-optin__label {
  font-size: 14px;
  line-height: 1.45;
  color: var(--fg-primary);
  font-weight: 500;
}
.yj-optin__help {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--fg-tertiary);
}
.yj-optin__help b { color: var(--fg-secondary); font-weight: 500; }

/* A3 — phone present, opt-in off → honest fallback, no dark-pattern nudge */
.yj-consent__fallback {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--status-info-bg);
  border: 1px solid color-mix(in oklab, var(--status-info) 18%, transparent);
}
.yj-consent__fallback svg { width: 15px; height: 15px; stroke-width: 1.8; color: var(--status-info); flex-shrink: 0; margin-top: 1px; }
.yj-consent__fallback p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--canopy-700); }
.yj-consent__fallback b { font-weight: 500; }

/* A4 — provider manual booking records consent truthfully */
.yj-consent--manual { border-style: dashed; }
.yj-consent--manual .yj-consent__eyebrow svg { color: var(--canopy-500); }
.yj-consent__manualnote {
  margin: -2px 0 13px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg-tertiary);
  font-style: italic;
}

/* =====================================================================
 * C · AT-RISK FLAG  (day board)
 *   "Reminder not delivered" — sunlight/danger accent so it reads as
 *   act-now, visually tied to the failed feed send (B5).
 * =================================================================== */
.yj-atrisk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--status-danger);
  background: var(--status-danger-bg);
  border: 1px solid color-mix(in oklab, var(--status-danger) 30%, transparent);
  border-radius: 999px;
  padding: 3px 9px 3px 7px;
}
.yj-atrisk__icon {
  width: 12px; height: 12px;
  flex-shrink: 0;
  display: grid; place-items: center;
}
.yj-atrisk__icon svg { width: 12px; height: 12px; stroke-width: 2; }

/* on a day-board grid cell — a thin danger rail + a corner glyph */
.yj-atrisk-cell {
  position: relative;
  box-shadow: inset 3px 0 0 0 var(--status-danger);
}
.yj-atrisk-cell::after {
  content: "";
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--status-danger);
  box-shadow: 0 0 0 2px var(--bg-surface);
  animation: yj-pulse-danger 1800ms ease-out infinite;
}
@keyframes yj-pulse-danger {
  0%, 100% { box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 0 rgba(162,58,46,0.5); }
  60%      { box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 6px rgba(162,58,46,0); }
}

/* mobile agenda card (003) — a full-width at-risk strip on the card */
.yj-atrisk-strip {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--status-danger-bg);
  border: 1px solid color-mix(in oklab, var(--status-danger) 26%, transparent);
}
.yj-atrisk-strip__icon { color: var(--status-danger); flex-shrink: 0; display: grid; place-items: center; }
.yj-atrisk-strip__icon svg { width: 17px; height: 17px; stroke-width: 1.9; }
.yj-atrisk-strip__txt { flex: 1; min-width: 0; }
.yj-atrisk-strip__t { display: block; font-size: 12.5px; font-weight: 600; color: var(--status-danger); line-height: 1.25; }
.yj-atrisk-strip__s { display: block; font-size: 11.5px; color: var(--mist-600); margin-top: 1px; line-height: 1.4; }
.yj-atrisk-strip__cta {
  flex-shrink: 0;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--status-danger);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
}

/* 003 day-board agenda card carrying the strip: let it wrap a full-width row
   under the grid, and echo the danger accent on the card edge. */
.yj-db-item--atrisk {
  border-color: color-mix(in oklab, var(--status-danger) 34%, transparent) !important;
  box-shadow: inset 3px 0 0 0 var(--status-danger);
}

/* C2 — the at-risk copilot card (same needs-attention slot, danger-tinted) */
.yj-db-copilot--atrisk {
  border-color: color-mix(in oklab, var(--status-danger) 30%, transparent) !important;
  background: var(--status-danger-bg) !important;
}
.yj-db-copilot--atrisk .yj-db-copilot__mark { background: var(--status-danger) !important; color: #fff !important; }
.yj-db-copilot--atrisk .yj-db-copilot__mark::after { animation: yj-pulse-danger 1800ms ease-out infinite !important; }
.yj-db-copilot--atrisk .yj-db-copilot__mark svg { width: 16px; height: 16px; stroke-width: 2; }
.yj-db-copilot--atrisk .yj-db-copilot__eyebrow { color: var(--status-danger) !important; }
.yj-db-copilot--atrisk .yj-db-copilot__txt { color: var(--mist-700) !important; }
.yj-db-copilot--atrisk .yj-db-copilot__cta a {
  border: 0; background: transparent; font-family: inherit;
  font-size: 12.5px; font-weight: 600; color: var(--status-danger);
  cursor: pointer; padding: 0; text-decoration: none;
}
.yj-db-copilot--atrisk .yj-db-copilot__cta button { color: var(--status-danger); }
.yj-db-copilot--atrisk .yj-db-copilot__cta button.dismiss { color: var(--fg-tertiary); font-weight: 400; }

/* =====================================================================
 * D · QUIET-HOURS / CHANNEL-POLICY PANEL  (settings)
 * =================================================================== */
.yj-policy { display: flex; flex-direction: column; gap: 22px; }
.yj-policy__group {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg, 14px);
  background: var(--bg-surface);
  overflow: hidden;
}
.yj-policy__grouphead {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-sunken);
}
.yj-policy__grouphead h4 {
  margin: 0 0 3px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--fg-brand);
}
.yj-policy__grouphead p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--fg-tertiary); }
.yj-policy__body { padding: 18px; }

/* send-window picker */
.yj-window {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.yj-window__field { display: flex; flex-direction: column; gap: 6px; }
.yj-window__field > label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
}
.yj-window__field select {
  min-height: 44px;
  min-width: 116px;
  padding: 0 13px;
  border: 1px solid var(--border-default);
  border-radius: 11px;
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--fg-primary);
  outline: none;
  cursor: pointer;
}
.yj-window__field select:focus { border-color: var(--canopy-400); box-shadow: var(--ring-focus); }
.yj-window__dash { padding-bottom: 11px; color: var(--fg-muted); font-family: var(--font-mono); }
.yj-window__hint {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--fg-tertiary);
}
.yj-window__hint b { color: var(--fg-secondary); font-weight: 500; }

/* a small visual track showing blocked vs allowed across 24h */
.yj-window__track {
  position: relative;
  height: 30px;
  margin-top: 14px;
  border-radius: 8px;
  background: var(--status-success-bg);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}
.yj-window__blocked {
  position: absolute;
  top: 0; bottom: 0;
  background: repeating-linear-gradient(45deg, var(--mist-100), var(--mist-100) 5px, var(--mist-50) 5px, var(--mist-50) 10px);
  border-right: 1px solid var(--border-default);
  border-left: 1px solid var(--border-default);
}
.yj-window__ticks { position: absolute; inset: 0; display: flex; justify-content: space-between; padding: 0 6px; align-items: center; pointer-events: none; }
.yj-window__ticks span { font-family: var(--font-mono); font-size: 8.5px; color: var(--fg-muted); }

/* D3 — widen rejection (inline, not destructive) */
.yj-policy__reject {
  display: none;
  gap: 9px;
  align-items: flex-start;
  margin-top: 13px;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--status-danger-bg);
  border: 1px solid color-mix(in oklab, var(--status-danger) 26%, transparent);
}
.yj-policy__reject[data-show="true"] { display: flex; }
.yj-policy__reject svg { width: 15px; height: 15px; stroke-width: 1.9; color: var(--status-danger); flex-shrink: 0; margin-top: 1px; }
.yj-policy__reject p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--mist-700); }
.yj-policy__reject b { color: var(--status-danger); font-weight: 600; }

/* sender ID display (read-only) */
.yj-sender {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-page);
}
.yj-sender__id {
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.12em;
  font-weight: 500;
  color: var(--fg-brand);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 7px 13px;
}
.yj-sender__meta { flex: 1; min-width: 0; }
.yj-sender__meta .l { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-tertiary); }
.yj-sender__meta .v { display: block; margin-top: 2px; font-size: 12.5px; color: var(--fg-secondary); line-height: 1.45; }
.yj-sender__acma {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--status-success);
  background: var(--status-success-bg);
  border: 1px solid color-mix(in oklab, var(--status-success) 24%, transparent);
  border-radius: 999px;
  padding: 4px 10px;
}
.yj-sender__acma svg { width: 12px; height: 12px; stroke-width: 2; }

/* per-channel toggle rows */
.yj-chanrow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-top: 1px solid var(--border-subtle);
}
.yj-chanrow:first-child { border-top: 0; }
.yj-chanrow__icon {
  width: 36px; height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--bg-sunken);
  color: var(--fg-secondary);
}
.yj-chanrow__icon svg { width: 18px; height: 18px; stroke-width: 1.7; }
.yj-chanrow__txt { flex: 1; min-width: 0; }
.yj-chanrow__name { font-size: 14.5px; font-weight: 500; color: var(--fg-primary); display: flex; align-items: center; gap: 8px; }
.yj-chanrow__sub { font-size: 12px; color: var(--fg-tertiary); margin-top: 2px; line-height: 1.45; }
.yj-chanrow__tag {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  background: var(--bg-sunken);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  padding: 2px 7px;
}

/* desktop toggle (reuses mobile toggle visual) */
.yj-toggle {
  width: 46px; height: 28px; border-radius: 999px;
  background: var(--moss-400); position: relative; border: 0; cursor: pointer;
  flex-shrink: 0; margin-left: auto; transition: background 160ms;
}
.yj-toggle[data-on="false"] { background: var(--mist-300); }
.yj-toggle[disabled] { background: var(--mist-200); cursor: not-allowed; opacity: 0.7; }
.yj-toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  transition: transform 160ms var(--ease-out, ease); box-shadow: var(--shadow-sm);
}
.yj-toggle[data-on="true"]::after { transform: translateX(18px); }

/* =====================================================================
 * E · OPT-OUT LANDING PAGE  (standalone, no login, per-salon)
 * =================================================================== */
.yj-optout-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
  color: var(--fg-primary);
}
/* brandable per-salon header over the Yanyja system frame */
.yj-optout-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: max(18px, var(--yj-safe-t, 0px)) 22px 18px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}
.yj-optout-logo {
  width: 44px; height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--canopy-700);
  color: var(--sunlight-300);
  font-family: var(--font-display);
  font-size: 20px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.yj-optout-head__name { font-family: var(--font-display); font-size: 18px; font-weight: 400; color: var(--fg-brand); letter-spacing: -0.01em; line-height: 1.1; }
.yj-optout-head__sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-tertiary); margin-top: 3px; display: block; }
.yj-optout-head__yj { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-tertiary); }
.yj-optout-head__yj .yj-pulse-dot { width: 6px; height: 6px; }

.yj-optout-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 22px calc(32px + var(--yj-safe-b, 0px));
}
.yj-optout-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl, 20px);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
}
.yj-optout-card__eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-accent);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.yj-optout-card__mark {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: grid; place-items: center;
  margin-bottom: 18px;
}
.yj-optout-card__mark svg { width: 26px; height: 26px; stroke-width: 1.8; }
.yj-optout-card__mark--ask { background: var(--sunlight-50); color: var(--sunlight-600); }
.yj-optout-card__mark--done { background: var(--status-success-bg); color: var(--status-success); }
.yj-optout-card__mark--calm { background: var(--bg-sunken); color: var(--fg-secondary); }
.yj-optout-card__mark--warn { background: var(--status-danger-bg); color: var(--status-danger); }
.yj-optout-card h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--fg-brand);
  margin: 0 0 12px;
}
.yj-optout-card h1 em { font-style: italic; color: var(--canopy-500); }
.yj-optout-card p {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--fg-secondary);
  margin: 0 0 14px;
}
.yj-optout-card p b { color: var(--fg-primary); font-weight: 500; }
.yj-optout-card p:last-of-type { margin-bottom: 0; }

.yj-optout-scope {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 18px 0;
  padding: 13px 15px;
  border-radius: 12px;
  background: var(--bg-sunken);
  border: 1px solid var(--border-subtle);
}
.yj-optout-scope svg { width: 17px; height: 17px; stroke-width: 1.8; color: var(--canopy-500); flex-shrink: 0; margin-top: 1px; }
.yj-optout-scope p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--fg-secondary); }
.yj-optout-scope b { color: var(--fg-primary); font-weight: 500; }

.yj-optout-acts { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.yj-optout-btn {
  min-height: 50px;
  border-radius: 13px;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: background 130ms, border-color 130ms;
}
.yj-optout-btn--stop { background: var(--status-danger); color: #fff; }
.yj-optout-btn--stop:hover { background: color-mix(in oklab, var(--status-danger) 86%, #000); }
.yj-optout-btn--primary { background: var(--canopy-700); color: #fff; }
.yj-optout-btn--primary:hover { background: var(--canopy-800); }
.yj-optout-btn--ghost { background: var(--bg-surface); color: var(--fg-primary); border-color: var(--border-default); }
.yj-optout-btn--ghost:hover { background: var(--bg-sunken); }

.yj-optout-foot {
  text-align: center;
  padding: 0 22px calc(26px + var(--yj-safe-b, 0px));
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--fg-muted);
}
.yj-optout-foot a { color: var(--fg-tertiary); }
.yj-optout-foot .sid { font-family: var(--font-mono); letter-spacing: 0.08em; color: var(--fg-tertiary); }

@media (max-width: 480px) {
  .yj-optout-card { padding: 26px 20px; border-radius: 18px; }
  .yj-optout-card h1 { font-size: 24px; }
}

/* =====================================================================
 * Reduced motion
 * =================================================================== */
@media (prefers-reduced-motion: reduce) {
  .yj-delivery, .yj-delivery.yj-just-changed { transition: none; animation: none; }
  .yj-atrisk-cell::after { animation: none; }
  .yj-delivery[data-status="queued"] .yj-delivery__dot { animation: none; }
}
