/*
 * The back office in the landing page's language (23 Nov 2026). No values of its own: it reuses the site's tokens and
 * type classes (src/components/sms/site/revenue/revenue.css: --rv-*, .rv-eyebrow, .rv-stat …). A page opts in with
 * <BoPage> (class "rv-site bo-scope", inner "rv-theme-paper"), and the dark theme swaps in the site's night tokens.
 */
/* layout tokens: the list column (Conversations, Helpdesk) and the reading measure (a conversation, a document).
   Tailwind: w-list / basis-list / max-w-list, max-w-reading. Change them here, never with arbitrary px. */
:root { --layout-list: 400px; --layout-list-narrow: 360px; --measure-reading: 640px; }

/*
 * The scope keeps the app's own background; the paper surface carries the page.
 * Theme contrast (26 Nov 2026): the site's tokens are pairs, and BOTH halves follow the app's theme everywhere in the
 * back office (the scope itself, the shell, every surface), never the site's night defaults: --rv-bg is the surface the
 * ink sits on (the app's --background), so var(--rv-fg) on var(--rv-bg) and its inverse always contrast. Fills that
 * carry text use the paired app tokens (bg-inverse text-inverse-foreground, bg-brand-solid …; index.css).
 */
.rv-site.bo-scope { background: transparent; overflow-x: visible; }
.rv-site.bo-scope,
.rv-site.bo-scope .bo-surface {
  --rv-bg: var(--background);
  --rv-fg: var(--rv-ink);
  --rv-fg-2: var(--rv-ink-2);
  --rv-fg-3: var(--rv-ink-3-aa);
  --rv-line: var(--rv-line-l);
  --rv-line-2: var(--rv-line-l-2);
  --rv-accent-ink: var(--brand-ink);
}
.rv-site.bo-scope .bo-surface { background: transparent; color: var(--rv-fg); }
.dark .rv-site.bo-scope,
.dark .rv-site.bo-scope .bo-surface,
.dark .rv-site.bo-scope.bo-surface {
  --rv-bg: var(--background);
  --rv-fg: var(--rv-fg-d);
  --rv-fg-2: var(--rv-fg-d-2);
  --rv-fg-3: var(--rv-fg-d-3);
  --rv-line: var(--rv-line-d);
  --rv-line-2: var(--rv-line-d-2);
  --rv-accent-ink: var(--rv-accent);
}
.dark .rv-site.bo-scope .bo-surface, .dark .rv-site.bo-scope.bo-surface { color: var(--rv-fg); }

/* type: three sizes per page (title, number, body) plus the mono micro label */
.rv-site .bo-title { font-size: clamp(28px, 3.2vw, 40px); font-weight: 300; line-height: 1.08; letter-spacing: -0.04em; margin: 0; text-wrap: balance; }
/* a section's title in the page title's display style, one step smaller (Matt, 26 Nov 2026: "Unlock more by answering these doubts") */
.rv-site .bo-section-title { font-size: clamp(24px, 2.6vw, 32px); font-weight: 300; line-height: 1.1; letter-spacing: -0.035em; margin: 0; text-wrap: balance; }
/* a contained panel's heading: the display font at section size, clearly under the page title */
.rv-site .bo-panel-title { font-size: 22px; font-weight: 300; line-height: 1.2; letter-spacing: -0.03em; margin: 0; text-wrap: balance; }
.rv-site .bo-number { font-size: clamp(28px, 3vw, 36px); font-weight: 300; line-height: 1; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.rv-site .bo-hero-number { font-size: clamp(48px, 6vw, 76px); font-weight: 300; line-height: 1; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.rv-site .bo-body { font-size: 15px; font-weight: 400; line-height: 1.5; letter-spacing: -0.005em; color: var(--rv-fg); }
.rv-site .bo-muted { color: var(--rv-fg-3); }
.rv-site .bo-line { border-color: var(--rv-line); }
.rv-site .bo-line-2 { border-color: var(--rv-line-2); }

/* links: ink, underline on hover (never blue text) */
.rv-site .bo-link { color: var(--rv-fg); text-decoration: none; text-underline-offset: 4px; }
.rv-site .bo-link:hover { text-decoration: underline; text-decoration-color: var(--rv-line-2); }

/* the state marker: a small square (■ Bought, ■ Measuring), the site's own */
.rv-site .bo-square { width: 8px; height: 8px; border-radius: 1px; flex: none; }

/* the one button: ink, low radius (the inverse pair, so it flips with the theme wherever it sits) */
.rv-site .bo-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding-inline: 14px; border-radius: var(--rv-r-btn); background: var(--inverse); color: var(--inverse-foreground); font-size: 14px; font-weight: 500; transition: opacity 0.2s var(--rv-ease); }
.rv-site .bo-btn:hover { opacity: 0.88; }
.rv-site .bo-btn-quiet { background: transparent; color: var(--rv-fg); box-shadow: inset 0 0 0 1px var(--rv-line-2); }

/* motion: sections rise in turn, lines draw in, all off under reduced motion */
@keyframes bo-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes bo-draw { from { stroke-dashoffset: var(--bo-len, 400); } to { stroke-dashoffset: 0; } }
.rv-site .bo-rise { animation: bo-rise 0.6s var(--rv-ease) both; animation-delay: calc(var(--bo-i, 0) * 70ms); }
.rv-site .bo-draw { stroke-dasharray: var(--bo-len, 400); animation: bo-draw 1.1s var(--rv-ease) both; animation-delay: 0.2s; }
@media (prefers-reduced-motion: reduce) {
  .rv-site .bo-rise, .rv-site .bo-draw { animation: none; }
}
@keyframes bo-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.rv-site .bo-grow { transform-origin: left; animation: bo-grow 1.2s var(--rv-ease) both; animation-delay: 0.3s; }
@media (prefers-reduced-motion: reduce) { .rv-site .bo-grow { animation: none; } }

/* the shell: the site's typeface and ink, the app's own surfaces (sidebar, inset) */
.rv-site.bo-shell { color: inherit; background: inherit; overflow-x: visible; font-family: var(--rv-font-sans); }
.rv-site.bo-shell [data-sidebar='sidebar'] { font-family: var(--rv-font-sans); letter-spacing: -0.005em; }

/* a small dot grid (the site's 5.5px pixel pitch) that settles into the state's number: still under reduced motion */
.rv-site .bo-dotgrid {
  background-image: radial-gradient(circle, var(--rv-line-2) 1px, transparent 1.2px);
  background-size: 5.5px 5.5px;
  mask-image: linear-gradient(90deg, #000 0%, transparent 100%);
  animation: bo-dot-settle 1.2s var(--rv-ease) both;
}
@keyframes bo-dot-settle { from { opacity: 0; transform: scaleX(0.6); transform-origin: left; } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rv-site .bo-dotgrid { animation: none; } }

/* dark mode (next-themes' .dark class drives it): the highlight and the quiet button on the night tokens */
.dark .rv-site mark:not(.bo-mark) { background: rgba(var(--rv-glow-rgb), 0.16); color: inherit; }

/*
 * SHARED (Matt, 23 Nov 2026): the ONE highlight on a shopper's words, in the Gro brand blue (never gold): a blue tint
 * behind the phrase and a 2px blue underline under it; the text keeps the primary ink. `--brand` is the app's blue and
 * swaps for dark mode. Use class="bo-mark" on every <mark> (quotes, conversation bubbles, gold messages). Unscoped so it
 * works inside and outside .rv-site.
 */
.bo-mark {
  color: inherit;
  background: color-mix(in oklab, var(--brand) 14%, transparent);
  text-decoration: underline;
  text-decoration-color: var(--brand);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-skip-ink: none;
  border-radius: 2px;
  padding-inline: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.dark .bo-mark { background: color-mix(in oklab, var(--brand) 24%, transparent); }
.dark .rv-site .bo-dotgrid { background-image: radial-gradient(circle, var(--rv-line-d-2) 1px, transparent 1.2px); }

/* Skeleton bones: a component's own layout with `loading` (never a separate skeleton file). */
.rv-site .bo-bone { display: inline-block; border-radius: 6px; background: linear-gradient(90deg, var(--rv-line) 0%, color-mix(in oklab, var(--rv-line) 45%, transparent) 50%, var(--rv-line) 100%); background-size: 200% 100%; animation: bo-bone 1.4s ease-in-out infinite; color: transparent; }
@keyframes bo-bone { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .rv-site .bo-bone { animation: none; } }

/* light: the app's success green (#009C15) is 3.4:1 as text and under white text, so while the back office is mounted it
   takes the lift's AA green (--good, index.css) for both halves of its pair; the dark pair already passes */
:root:not(.dark):has(.bo-shell) {
  --success: var(--good);
  --success-channels: var(--good-channels);
  --success-foreground: var(--good-foreground);
  --success-foreground-channels: var(--good-foreground-channels);
}

/* dark: the back office sits on the landing's near-black (gro.app night), not the app's charcoal; surfaces a step up */
.dark:has(.bo-shell), .dark .rv-site.bo-shell {
  /* Tailwind's colour utilities read the -channels twins (for alpha), so both are set */
  --background: oklch(0.155 0.004 265);
  --background-channels: 0.155 0.004 265;
  --sidebar: oklch(0.185 0.004 265);
  --sidebar-channels: 0.185 0.004 265;
  --card: oklch(0.19 0.004 265);
  --card-channels: 0.19 0.004 265;
  --popover: oklch(0.2 0.004 265);
  --popover-channels: 0.2 0.004 265;
  --secondary: oklch(0.24 0.004 265);
  --secondary-channels: 0.24 0.004 265;
  --border: oklch(0.29 0.004 265);
  --border-channels: 0.29 0.004 265;
}


/* SHARED (agent D, 24 Nov 2026): story motion for mini outcomes, played once when they come into view, then at rest.
   bo-type types a line in (set --bo-ch to its length), bo-pop pops a reaction in, bo-ping rings a dot twice, bo-fill
   lights a pixel after its --bo-delay. Under reduced motion everything shows its final state. */
@keyframes bo-type { from { max-width: 0; } to { max-width: var(--bo-ch, 32ch); } }
.rv-site .bo-type { display: inline-block; overflow: hidden; white-space: nowrap; vertical-align: bottom; animation: bo-type var(--bo-dur, 1.1s) steps(var(--bo-steps, 32)) both; animation-delay: var(--bo-delay, 0.3s); }
@keyframes bo-pop { 0% { opacity: 0; transform: scale(0.4); } 70% { opacity: 1; transform: scale(1.15); } 100% { opacity: 1; transform: scale(1); } }
.rv-site .bo-pop { animation: bo-pop 0.45s var(--rv-ease) both; animation-delay: var(--bo-delay, 1.5s); }
@keyframes bo-ping { from { transform: scale(1); opacity: 0.55; } to { transform: scale(3.2); opacity: 0; } }
.rv-site .bo-ping { transform-box: fill-box; transform-origin: center; opacity: 0; animation: bo-ping 1.1s ease-out 2; animation-delay: var(--bo-delay, 1.3s); }
@keyframes bo-fill { from { opacity: 0.12; } to { opacity: 1; } }
.rv-site .bo-fill { animation: bo-fill 0.25s var(--rv-ease) both; animation-delay: var(--bo-delay, 0s); }
@media (prefers-reduced-motion: reduce) {
  .rv-site .bo-type, .rv-site .bo-pop, .rv-site .bo-fill { animation: none; }
  .rv-site .bo-ping { animation: none; display: none; }
}
