/* /demos/en-vivo: layout and panel states only. Everything shared comes from style.css
   (.dx-pill, .dx-live, .dx-n, .m-btn/.m-btn-wa, .m-card with its 4px --card-accent band)
   and from family.css: every colour, radius, shadow and font here is a var(--sentria-*),
   the same rule `npm run check:colours` and TestStylesheetUsesFamilyTokens enforce.
   Card bands (spec): blue for the owner panel (the .m-card default), teal for the agent card. */

.envivo { overflow-x: clip; }
/* JS toggles the hidden attribute; a class display rule would beat the UA's
   [hidden] display:none and leave "hidden" states painted. */
.envivo [hidden] { display: none; }

/* Hero: slightly tighter than /demos (the panel below is the star, not the pitch). */
.envivo-hero .dx-h1 { margin-bottom: 1.1rem; }
.envivo-hero .dx-lead { margin-bottom: 0; }

/* Two columns from 900px: agent card left, owner panel right, the panel sticky (spec). */
.envivo-main { padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 4.5rem); }
.envivo-grid { display: grid; grid-template-columns: 1fr; gap: clamp(1.25rem, 3vw, 2rem); align-items: start; }
@media (min-width: 900px) {
  .envivo-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(2rem, 4vw, 3.5rem); }
  .envivo-panel { position: sticky; top: calc(var(--header-h) + 1.25rem); }
}

/* Agent card (teal band): steps + the WhatsApp button. */
.envivo-agent { gap: clamp(1.25rem, 2.5vw, 1.75rem); }
.envivo-agent h2 { font-size: 1.375rem; letter-spacing: -0.02em; }
.envivo-steps { display: flex; flex-direction: column; align-self: stretch; } /* stretch: .m-card sets align-items:flex-start, which would shrink the list and stop the dividers short of the card width */
.envivo-steps li { display: flex; align-items: center; gap: 0.9rem; padding: 0.7rem 0; font-weight: 600; color: var(--sentria-ink); }
.envivo-steps li + li { border-top: 1px solid var(--sentria-hairline-soft); }
.envivo-steps .dx-n { width: 2.2rem; height: 2.2rem; min-width: 2.2rem; font-size: 1rem; margin-bottom: 0; }
.envivo-wa-note { margin: 0; font-size: var(--sentria-text-sm); color: var(--sentria-muted); }

/* Owner panel (blue band): a header strip plus the live list. */
.envivo-panel { align-items: stretch; padding: 0; overflow: hidden; }
.envivo-panel-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem 0.6rem; padding: 0.9rem clamp(1.25rem, 2.5vw, 1.75rem); background: var(--sentria-sunken); border-bottom: 1px solid var(--sentria-hairline); }
.envivo-panel-title { margin: 0; font-size: 1rem; letter-spacing: -0.01em; }
.envivo-updated { margin: 0 0 0 auto; font-size: var(--sentria-text-sm); color: var(--sentria-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.envivo-panel-body { position: relative; display: flex; flex-direction: column; min-height: 17.5rem; padding: clamp(1rem, 2vw, 1.25rem); }

/* Loading: skeleton rows while the first poll is in flight. */
.envivo-loading-label { margin: 0 0 1rem; font-size: var(--sentria-text-sm); color: var(--sentria-muted); }
.envivo-skel { display: flex; flex-direction: column; gap: 0.75rem; margin: 0; padding: 0; }
.envivo-skel li { height: 3.6rem; border-radius: var(--sentria-radius-md); background: linear-gradient(90deg, var(--sentria-sunken) 25%, var(--sentria-hairline-soft) 50%, var(--sentria-sunken) 75%); background-size: 200% 100%; animation: envivo-shimmer 1.5s linear infinite; }
@keyframes envivo-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Empty: nobody has booked yet. */
.envivo-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem; text-align: center; color: var(--sentria-muted); }
.envivo-empty svg { color: var(--sentria-hairline-strong); margin-bottom: 0.6rem; }
.envivo-empty-title { margin: 0; font-size: 1.0625rem; font-weight: 600; color: var(--sentria-ink); }
.envivo-empty-sub { margin: 0; font-size: var(--sentria-text-sm); max-width: 32ch; }

/* Booking rows: newest first, at most 8 (the JS caps and reorders; this is pure looks). */
.envivo-list { display: flex; flex-direction: column; gap: 0.6rem; margin: 0; padding: 0; }
.envivo-row { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.75rem 1rem; background: var(--sentria-sunken); border: 1px solid var(--sentria-hairline-soft); border-radius: var(--sentria-radius-md); transition: background var(--sentria-medium) var(--sentria-ease), border-color var(--sentria-medium) var(--sentria-ease); }
.envivo-row.is-new { animation: envivo-in var(--sentria-medium) var(--sentria-ease); }
@keyframes envivo-in { from { opacity: 0; transform: translateY(-0.4rem); } }
.envivo-row.is-fresh { background: var(--sentria-live-soft); border-color: var(--sentria-live); }
.envivo-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.envivo-row-title { font-size: var(--sentria-text-md); font-weight: 600; color: var(--sentria-ink); }
.envivo-row-when { font-size: var(--sentria-text-sm); color: var(--sentria-muted); font-variant-numeric: tabular-nums; }
.envivo-row.is-cancelled { background: var(--sentria-sunken); border-style: dashed; }
.envivo-row.is-cancelled .envivo-row-title, .envivo-row.is-cancelled .envivo-row-when { text-decoration: line-through; color: var(--sentria-muted); }

/* Status pill: text always carries the state (never colour alone). */
.envivo-pill { flex-shrink: 0; padding: 0.15rem 0.6rem; border-radius: var(--sentria-radius-pill); font-size: var(--sentria-text-xs); font-weight: 600; line-height: 1.4; white-space: nowrap; background: var(--sentria-sunken); color: var(--sentria-muted); }
.envivo-pill[data-state='confirmed'] { background: var(--sentria-ok-soft); color: var(--sentria-ok); }
.envivo-pill[data-state='moved'] { background: var(--sentria-info-soft); color: var(--sentria-info); }

/* Offline banner: role=alert in the markup; the JS keeps the last list under it. */
.envivo-error { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.9rem; padding: 0.6rem 0.9rem; border-radius: var(--sentria-radius-md); background: var(--sentria-bad-soft); color: var(--sentria-bad); font-size: var(--sentria-text-sm); font-weight: 600; }

/* The polite announcements live off-screen; screen readers read them, nobody sees them. */
.envivo-status { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* Footer note. */
.envivo-note { margin: clamp(1.5rem, 3vw, 2rem) 0 0; padding-top: 1.1rem; border-top: 1px solid var(--sentria-hairline-soft); font-size: var(--sentria-text-sm); color: var(--sentria-muted); }

/* Spec: reduced motion keeps the tint, drops the slide and the shimmer. */
@media (prefers-reduced-motion: reduce) {
  .envivo-row.is-new { animation: none; }
  .envivo-skel li { animation: none; }
}

/* Small screens: the chat launcher is viewport-fixed (#sc-chat-btn, style.css:
   56px + 16px off the bottom up to 600px), so padding below the CTA cannot move
   it out from under the button — instead the CTA is lifted clear of the
   launcher's band by tightening this page's own hero/main padding (390px: CTA
   bottom 816 -> 712, band top 772; the hero wraps deeper at 360px, hence the
   full lift). Must stay after the .envivo-main rule above: same specificity,
   source order decides. */
@media (max-width: 600px) {
  .envivo-hero { padding: 1.5rem 0; }
  .envivo-main { padding-top: 0; }
}