/* Home e prévias do CMS usam os tokens do Design System; sem tema fixo. */
.home-vitrine {
  --home-heading: var(--by-primary);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  min-width: 0;
  max-width: 100%;
  color: var(--by-text);
  line-height: 1.5;
}
[data-by-theme="dark"] .home-vitrine { --home-heading: var(--by-text); }
.home-vitrine [hidden] { display: none !important; }
.home-vitrine :is(button, a, video, [tabindex]):focus-visible { outline: 2px solid var(--by-focus); outline-offset: 3px; }
.home-vitrine img { display: block; max-width: 100%; }
.home-vitrine :is(h1, h2, h3, p, strong, small) { overflow-wrap: anywhere; }
.home-vitrine :is(h1, h2, h3) { color: var(--home-heading); }
.home-vitrine :is(p, small) { letter-spacing: normal; }
.home-header { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.home-header > div { min-width: 0; }
.home-eyebrow { margin: 0 0 8px; color: var(--by-text-muted); font-size: 11px; font-weight: 700; letter-spacing: .07em !important; }
.home-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.home-title-row h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; }
.home-brand-pill { display: inline-flex; max-width: 100%; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--by-border); background: var(--by-surface); color: var(--by-text-muted); font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.home-subtitle { margin: 8px 0 0; font-size: 14px; color: var(--by-text-muted); }
.home-dash-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 14px; border: 1px solid var(--by-control-border); border-radius: var(--by-radius-button); background: var(--by-surface); color: var(--by-link); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.home-dash-btn:hover { border-color: var(--by-focus); }

/* A operação da unidade permanece disponível sem depender do feed. */
.home-shortcuts, .home-feed, .home-section { display: grid; gap: 16px; min-width: 0; }
.home-shortcuts, .home-feed { container: home-workspace / inline-size; }
.home-feed { gap: 20px; padding-top: 24px; border-top: 1px solid var(--by-border); }
.home-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.home-section-head h2 { margin: 0; font-size: 18px; font-weight: 750; line-height: 1.4; letter-spacing: -.015em; }
.home-section-head p { margin: 5px 0 0; color: var(--by-text-muted); font-size: 13px; }
.home-shortcut-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
#content .home-vitrine .home-shortcut { display: flex; align-items: flex-start; gap: 12px; min-width: 0; padding: 18px 16px; text-align: left; border: 1px solid var(--by-border); border-radius: var(--by-radius-card); background: var(--by-surface); color: var(--by-text); box-shadow: var(--ds-shadow-card); font: inherit; }
#content .home-vitrine .home-shortcut:hover { border-color: var(--by-focus); }
.home-shortcut > .ico { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 2px; color: var(--by-link); }
.home-shortcut > span:not(.home-shortcut-arrow) { display: grid; gap: 5px; min-width: 0; }
.home-shortcut strong { color: var(--home-heading); font-size: 14px; font-weight: 700; }
.home-shortcut small { color: var(--by-text-muted); font-size: 12px; font-weight: 400; line-height: 1.5; }
.home-shortcut-pill { display: inline-flex; width: fit-content; margin-top: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-style: normal; font-weight: 700; line-height: 1.4; }
.home-shortcut-pill.is-warn { background: color-mix(in srgb, var(--by-accent) 22%, var(--by-surface)); color: var(--by-warning-text, #92400e); border: 1px solid color-mix(in srgb, var(--by-accent) 55%, transparent); }
.home-shortcut-pill.is-ok { background: var(--by-primary-soft); color: var(--by-link); border: 1px solid var(--by-border); }
.home-shortcut-arrow { margin-left: auto; color: var(--by-text-muted); }

/* Painel ao vivo de check-ins TotalPass na Home e Controle de entradas. */
.tp-live-card { display: grid; gap: 14px; padding: 18px 20px; border: 1px solid var(--by-border); border-radius: var(--by-radius-card); background: var(--by-surface); box-shadow: var(--ds-shadow-card); }
.tp-live-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.tp-live-head h3 { margin: 0; font-size: 16px; font-weight: 750; color: var(--by-text); }
.tp-live-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--by-text-muted); }
.tp-live-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tp-live-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tp-live-badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1.3; }
.tp-live-badge.is-ok { background: var(--by-primary-soft); color: var(--by-link); border: 1px solid var(--by-border); }
.tp-live-badge.is-warn { background: color-mix(in srgb, var(--by-accent) 24%, var(--by-surface)); color: var(--by-warning-text, #92400e); border: 1px solid color-mix(in srgb, var(--by-accent) 60%, transparent); }
.tp-live-btn { min-height: 36px; padding: 6px 12px; border: 1px solid var(--by-control-border); border-radius: var(--by-radius-button); background: var(--by-surface); color: var(--by-link); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.tp-live-btn:hover { border-color: var(--by-focus); }
.tp-live-feedback { margin: 0; padding: 10px 12px; border-radius: var(--by-radius-field); font-size: 13px; font-weight: 600; }
.tp-live-feedback.is-ok { background: color-mix(in srgb, #16a34a 12%, var(--by-surface)); color: var(--by-success-text, #166534); border: 1px solid color-mix(in srgb, #16a34a 35%, transparent); }
.tp-live-feedback.is-bad { background: color-mix(in srgb, #dc2626 12%, var(--by-surface)); color: var(--by-danger-text, #991b1b); border: 1px solid color-mix(in srgb, #dc2626 35%, transparent); }
.tp-live-table-wrap { overflow-x: auto; }
.tp-live-table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tp-live-table-wrap th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--by-text-muted); padding: 8px 10px; border-bottom: 1px solid var(--by-border); }
.tp-live-table-wrap td { padding: 10px; border-bottom: 1px solid var(--by-border); vertical-align: middle; }
.tp-live-table-wrap tbody tr:last-child td { border-bottom: 0; }
.tp-live-status { display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.tp-live-status.is-ok { background: color-mix(in srgb, #16a34a 15%, var(--by-surface)); color: var(--by-success-text, #166534); }
.tp-live-status.is-warn { background: color-mix(in srgb, var(--by-accent) 26%, var(--by-surface)); color: var(--by-warning-text, #92400e); }
.tp-live-status.is-bad { background: color-mix(in srgb, #dc2626 14%, var(--by-surface)); color: var(--by-danger-text, #991b1b); }
.tp-live-status.is-muted { background: var(--by-surface-muted); color: var(--by-text-muted); }
.tp-live-confirm-btn { min-height: 34px; padding: 6px 12px; font-size: 12.5px; }
.tp-live-empty { margin: 0; font-size: 13px; }
.home-feed-state { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border: 1px solid var(--by-border); border-radius: var(--by-radius-card); background: var(--by-surface); }
.home-feed-state h3 { margin: 0; font-size: 15px; font-weight: 700; }
.home-feed-state p { margin: 5px 0 0; font-size: 13px; color: var(--by-text-muted); }
.home-feed-state.is-error { border-color: color-mix(in srgb, var(--by-warning-text) 30%, var(--by-border)); }
.home-feed-state button { min-height: 44px; }

.home-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.home-vitrine .home-cat-btn { min-height: 40px; padding: 8px 14px; border-radius: var(--by-radius-button); border: 1px solid var(--by-border); background: var(--by-surface); color: var(--by-text-muted); font-size: 13px; font-weight: 600; }
.home-vitrine .home-cat-btn:hover { border-color: var(--by-focus); }
.home-vitrine .home-cat-btn.is-active { background: var(--by-primary-soft); border-color: var(--by-focus); color: var(--by-link); box-shadow: inset 0 -3px 0 var(--by-accent); }
.home-top-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.home-top-grid.is-single { grid-template-columns: minmax(0, 1fr); }

/* Destaque com texto em superfície legível e mídia em área própria. */
.home-hero-card { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); min-width: 0; min-height: 280px; overflow: hidden; border: 1px solid var(--by-border); border-radius: var(--by-radius-card); background: var(--by-primary-soft); color: var(--by-text); box-shadow: var(--ds-shadow-card); }
.home-hero-media { position: relative; grid-column: 2; grid-row: 1 / 3; min-width: 0; min-height: 0; background: var(--by-surface-muted); }
.home-hero-media :is(picture, img) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.home-hero-scrim, .home-hero-card:not(.has-media) .home-hero-media { display: none; }
.home-hero-body { grid-column: 1; grid-row: 1; display: grid; align-content: center; gap: 12px; min-width: 0; padding: 24px; }
.home-hero-card:not(.has-media) .home-hero-body { grid-column: 1 / -1; }
.home-hero-body h2 { margin: 0; font-size: clamp(22px, 2.1vw, 30px); font-weight: 800; line-height: 1.2; letter-spacing: -.025em; }
.home-hero-body p { margin: 0; font-size: 14px; color: var(--by-text-muted); line-height: 1.65; }
.home-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 4px; }
.home-hero-controls { grid-column: 1; grid-row: 2; display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; padding: 0 20px 16px; }
.home-hero-card:not(.has-media) .home-hero-controls { grid-column: 1 / -1; }
.home-hero-dots { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-width: 0; }
.home-vitrine .home-dot { display: grid; place-items: center; width: 32px; min-width: 32px; height: 36px; min-height: 36px; padding: 0; border: 0; border-radius: var(--by-radius-button); background: transparent; }
.home-dot > span { display: block; width: 7px; height: 7px; border-radius: 999px; background: var(--by-text-muted); }
.home-dot.is-active > span { width: 20px; background: var(--by-link); }
.home-slide-count { color: var(--by-text-muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.home-hero-arrows { display: flex; gap: 6px; }
.home-vitrine .home-arrow { display: grid; place-items: center; width: 36px; height: 36px; min-height: 36px; padding: 0; border: 1px solid var(--by-control-border); border-radius: var(--by-radius-button); color: var(--by-link); background: var(--by-surface); font-size: 22px; line-height: 1; }

.home-video-card, .home-solution-card { display: flex; flex-direction: column; min-width: 0; max-width: 100%; overflow: hidden; border: 1px solid var(--by-border); border-radius: var(--by-radius-card); background: var(--by-surface); box-shadow: var(--ds-shadow-card); }
.home-video-thumb, .home-solution-thumb { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: var(--by-surface-muted); }
.home-solution-thumb { aspect-ratio: 3 / 2; }
.home-video-thumb :is(picture, img), .home-solution-thumb :is(picture, img) { display: block; width: 100%; height: 100%; object-fit: cover; }
.home-vitrine .home-play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 56px; height: 56px; min-width: 56px; min-height: 56px; padding: 0; border-radius: 50%; border: 1px solid var(--by-control-border); background: var(--by-surface); color: var(--by-link); box-shadow: var(--ds-shadow-card); }
.home-play-btn svg { width: 24px; height: 24px; fill: currentColor; margin-left: 3px; }
.home-video-duration { position: absolute; right: 10px; bottom: 10px; padding: 4px 8px; border-radius: 8px; background: var(--by-surface); color: var(--by-text); border: 1px solid var(--by-border); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.home-video-body, .home-solution-body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; flex: 1; min-width: 0; padding: 20px; }
.home-kicker { color: var(--by-text-muted); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.home-video-body h3, .home-solution-body h3 { margin: 0; font-size: 16px; line-height: 1.4; font-weight: 700; }
.home-video-body p, .home-solution-body p { margin: 0; font-size: 13px; color: var(--by-text-muted); line-height: 1.6; }
.home-video-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: auto; padding-top: 8px; }
.home-vitrine :is(.home-video-watch, .home-see-all) { min-height: 40px; padding: 8px 0; border: 0; background: transparent; color: var(--by-link); font-size: 13px; font-weight: 700; }
.home-vitrine :is(.home-video-watch, .home-see-all):hover { text-decoration: underline; text-underline-offset: 3px; }
.home-pill { display: inline-flex; width: fit-content; max-width: 100%; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.home-pill-blue { background: var(--by-primary-soft); color: var(--by-link); border: 1px solid var(--by-border); }
.home-pill-yellow { background: var(--by-accent); color: var(--by-accent-fg, var(--ds-on-gold)); }
.home-cta { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; max-width: 100%; padding: 10px 16px; border-radius: var(--by-radius-button); border: 1px solid transparent; font-size: 13px; font-weight: 700; line-height: 1.4; text-align: center; text-decoration: none; overflow-wrap: anywhere; }
.home-cta:hover { text-decoration: underline; text-underline-offset: 3px; }
.home-vitrine .home-cta-yellow { background: var(--by-accent); border-color: var(--by-accent); color: var(--by-accent-fg, var(--ds-on-gold)) !important; }
.home-vitrine .home-cta-blue { background: var(--by-primary); color: var(--by-on-primary) !important; }
.home-vitrine .home-cta-outline { background: var(--by-surface); border-color: var(--by-control-border); color: var(--by-link) !important; }
.home-vitrine .home-cta-link { padding: 10px 0; color: var(--by-link) !important; text-decoration: underline; text-underline-offset: 3px; }
.home-solutions-grid, .home-video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.home-card-badge { position: absolute; top: 12px; left: 12px; max-width: calc(100% - 24px); }
.home-solution-foot { margin-top: auto; padding-top: 8px; }
.home-notices-list { display: grid; gap: 12px; }
.home-notice-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 20px; border: 1px solid var(--by-border); border-radius: var(--by-radius-card); background: var(--by-surface); }
.home-notice-left { display: flex; align-items: center; gap: 14px; flex: 1 1 280px; min-width: 0; flex-wrap: wrap; }
.home-notice-left > div:last-child { flex: 1 1 180px; min-width: 0; }
.home-notice-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--by-primary-soft); color: var(--by-link); flex: none; }
.home-notice-ico svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.home-notice-thumb { width: 96px; height: 58px; border-radius: 10px; overflow: hidden; flex: none; background: var(--by-surface-muted); }
.home-notice-thumb :is(picture, img) { display: block; width: 100%; height: 100%; object-fit: cover; }
.home-notice-left h3 { margin: 0; font-size: 15px; font-weight: 700; }
.home-notice-left p { margin: 5px 0 0; font-size: 13px; color: var(--by-text-muted); }
.home-media-fallback { display: grid; place-items: center; width: 100%; height: 100%; color: var(--by-text-muted); }
.home-media-fallback svg { width: 40px; height: 40px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.home-empty-card { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 24px; border: 1px solid var(--by-border); border-radius: var(--by-radius-card); background: var(--by-surface); }
.home-empty-card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.home-empty-card p { margin: 0; color: var(--by-text-muted); font-size: 13px; }

/* Acima da barra fixa; o isolamento e o foco são sincronizados pelo módulo. */
body.home-video-open { overflow: hidden; }
.home-modal-backdrop { position: fixed; inset: 0; background: color-mix(in srgb, var(--by-nav) 76%, transparent); z-index: 190; }
.home-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(760px, calc(100vw - 28px)); max-height: calc(100dvh - 36px); overflow: auto; border: 1px solid var(--by-border); border-radius: var(--by-radius-dialog); background: var(--by-surface); color: var(--by-text); z-index: 191; overscroll-behavior: contain; }
.home-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px; border-bottom: 1px solid var(--by-border); }
.home-modal-head > div { min-width: 0; }
.home-modal-head h2 { margin: 5px 0 0; font-size: 18px; line-height: 1.4; }
.home-vitrine .home-modal-close { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px solid var(--by-control-border); border-radius: var(--by-radius-button); background: var(--by-surface); color: var(--by-text); font-size: 24px; }
.home-modal-body { padding: 20px; display: grid; gap: 16px; }
.home-video-player { width: 100%; max-height: 420px; border-radius: var(--by-radius-field); background: var(--by-nav); }
.home-video-external { display: grid; gap: 16px; justify-items: start; padding: 20px; border-radius: var(--by-radius-card); border: 1px solid var(--by-border); background: var(--by-surface-muted); }
.home-video-external p { margin: 0; }

@container home-workspace (max-width: 1000px) {
  .home-shortcut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-top-grid { grid-template-columns: minmax(0, 1fr); }
  .home-solutions-grid, .home-video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container home-workspace (max-width: 600px) {
  .home-title-row h1 { font-size: 24px; }
  .home-header > .home-dash-btn { width: 100%; }
  .home-hero-card { grid-template-columns: minmax(0, 1fr); }
  .home-hero-card.has-media .home-hero-media { grid-column: 1; grid-row: 1; min-height: 0; height: 180px; }
  .home-hero-card.has-media .home-hero-body { grid-column: 1; grid-row: 2; }
  .home-hero-card.has-media .home-hero-controls { grid-column: 1; grid-row: 3; }
  .home-hero-body { padding: 20px; }
  .home-hero-controls { padding: 0 16px 14px; }
  .home-hero-body h2 { font-size: 24px; }
  .home-solutions-grid, .home-video-grid { grid-template-columns: minmax(0, 1fr); }
  .home-notice-card, .home-video-body, .home-solution-body { padding: 16px; }
  .home-notice-right, .home-notice-right .home-cta { width: 100%; }
  .home-vitrine :is(.home-cat-btn, .home-dot, .home-arrow, .home-see-all, .home-video-watch) { min-height: 44px; }
  .home-vitrine :is(.home-dot, .home-arrow) { min-width: 44px; }
  #content .home-vitrine .home-shortcut { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; padding: 14px; }
  .home-shortcut > span:not(.home-shortcut-arrow) { grid-column: 1 / -1; }
  .home-shortcut-arrow { grid-column: 2; grid-row: 1; justify-self: end; }
  .home-feed-state { padding: 16px; }
  .home-feed-state button { width: 100%; }
  .home-modal-head, .home-modal-body { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { .home-vitrine * { scroll-behavior: auto; transition: none; } }
@media (max-width: 680px) {
  .home-title-row h1 { font-size: 24px; }
  .home-header > .home-dash-btn { width: 100%; }
  .home-modal-head, .home-modal-body { padding: 16px; }
}
