.live-layout {
  width: min(100%, 1150px);
  margin: auto;
  padding: clamp(16px, 4vw, 42px);
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}
.live-layout [hidden] { display: none; }
.live-panel {
  min-width: 0;
  background: #fff;
  border: 1px solid #e8dded;
  border-top: 4px solid #a775be;
  border-radius: 16px;
  padding: clamp(16px, 3vw, 26px);
}
.live-panel h1, .live-panel h2 { color: #5b2e6d; overflow-wrap: anywhere; }
.live-panel h2 { margin: 12px 0; font-size: 1.15rem; }
.live-panel p { margin: 12px 0; }
.rehearsal-notice { padding: 10px 12px; border-radius: 8px; background: #f1e7f5; color: #5b2e6d; }
.live-panel video {
  display: block;
  width: 100%;
  height: min(58dvh, 530px);
  background: #35223e;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 12px;
}
.live-panel form { display: grid; gap: 8px; margin: 12px 0; }
.live-panel label { font-weight: 700; }
.live-panel input, .live-panel select {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  border: 1px solid #b99dc6;
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: max(1rem, 16px);
}
.live-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #5b2e6d;
  border-radius: 10px;
  background: #5b2e6d;
  color: white;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.live-action.secondary { color: #5b2e6d; background: #fff; border-color: #ddbb83; }
.live-action:disabled { opacity: .55; cursor: default; }
.live-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.live-messages { list-style: none; max-height: 22rem; overflow: auto; padding: 0; }
.live-messages li { padding: 8px 0; border-bottom: 1px solid #e8dded; overflow-wrap: anywhere; }
.live-messages button { margin-left: 6px; }
.live-backoffice { display: grid; min-height: 100dvh; grid-template-columns: 264px minmax(0, 1fr); }
.live-backoffice .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; }
.live-backoffice .topbar { display: flex; align-items: center; }
.live-backoffice .live-panel { border: 0; }
.camera-toolbar, .camera-panel-close { display: none; }
.broadcast-camera { background: #171717; overflow: hidden; }
.broadcast-camera .backoffice { display: block; }
.broadcast-camera .sidebar, .broadcast-camera .topbar,
.broadcast-camera .studio-setup, .broadcast-camera .studio-launch,
.broadcast-camera #studioSchedule, .broadcast-camera #stopLive { display: none; }
.broadcast-camera .live-layout { display: block; width: 100%; max-width: none; padding: 0; }
.broadcast-camera [data-live-studio] {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 100dvh;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 104px max(16px, env(safe-area-inset-left));
  border-radius: 0;
  isolation: isolate;
  background: #171717;
  color: #fff;
}
.broadcast-camera [data-live-studio]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(#000b, transparent 30%, transparent 70%, #000d);
}
.broadcast-camera .studio-heading { margin: 0; color: #fff; font-size: 1.15rem; }
.studio-heading-row { display: flex; align-items: center; gap: 8px; }
.host-live-badge { padding: 4px 8px; border-radius: 6px; background: #a32139; color: #fff; font-size: .8rem; font-weight: 700; }
.host-live-badge.is-paused { background: #454545; }
.broadcast-camera #liveStatus:empty { display: none; }
.broadcast-camera #liveViewerCount { cursor: pointer; list-style: none; }
.broadcast-camera #liveViewerCount::-webkit-details-marker { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .host-live-badge:not(.is-paused) { animation: host-live-pulse 3s ease-in-out infinite; }
  @keyframes host-live-pulse { 50% { background-color: #be2b46; } }
}
.broadcast-camera #liveStatus { margin: 8px 0; max-width: min(100%, 32rem); }
.broadcast-camera #liveAudience { max-height: 30dvh; overflow: auto; background: #171717e8; border-radius: 8px; padding: 8px 12px; }
.broadcast-camera #liveVideo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
  background: #171717;
}
.broadcast-camera .camera-toolbar {
  position: absolute;
  inset-inline: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(4px, 1.5vw, 12px);
}
.camera-button {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: #2e2e2ef2;
  color: #fff;
  cursor: pointer;
}
.camera-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.camera-button[aria-pressed="true"], .camera-button:hover { background: #fff; color: #171717; }
.camera-button:disabled { opacity: .5; cursor: default; }
#pauseLive .resume-icon, #pauseLive[aria-pressed="true"] .pause-icon { display: none; }
#pauseLive[aria-pressed="true"] .resume-icon { display: inline; }
.camera-record { width: 60px; height: 60px; border: 2px solid white; }
.camera-record span { width: 42px; height: 42px; border-radius: 50%; background: #d32741; }
.camera-exit { background: #931b2d; }
.broadcast-camera #liveChat {
  position: fixed;
  z-index: 31;
  inset-inline: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right));
  bottom: calc(114px + env(safe-area-inset-bottom));
  max-height: 60dvh;
  max-width: 38rem;
  margin-inline: auto;
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 12px;
}
.broadcast-camera .camera-panel-close { display: inline-flex; }
.camera-comments {
  position: absolute;
  z-index: 1;
  inset-inline-start: max(16px, env(safe-area-inset-left));
  bottom: calc(122px + env(safe-area-inset-bottom));
  width: min(calc(100% - 32px), 360px);
}
.departments { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.departments h1 { grid-column: 1 / -1; color: #5b2e6d; }
.department { display: block; color: #5b2e6d; text-decoration: none; }
.on-air { color: #a32139; font-weight: 700; }
.live-product-image { width: min(100%, 180px); max-height: 180px; object-fit: contain; border-radius: 8px; }

.live-viewer-page {
  min-height: 100dvh;
  background: #f8f5fa;
  color: #5b2e6d;
}
.viewer-room {
  max-width: 880px;
  min-height: 100dvh;
  margin-inline: auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #fff;
}
.viewer-room [hidden] { display: none; }
.viewer-header, .viewer-actions {
  padding: 8px max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left));
  background: #ead9f0;
}
.viewer-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding-top: max(8px, env(safe-area-inset-top));
}
.viewer-header a { color: #5b2e6d; text-decoration: none; }
.viewer-back { display: inline-flex; min-height: 44px; align-items: center; gap: 5px; justify-self: start; }
.viewer-brand { font-size: clamp(1rem, 5vw, 1.4rem); font-weight: 800; white-space: nowrap; }
.viewer-brand small { color: #5b2e6d; background: #ddbb83; padding: 2px 5px; border-radius: 4px; font-size: .63em; letter-spacing: .1em; }
.viewer-header button { justify-self: end; }
.viewer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 7px 12px;
  border: 1px solid #b99dc6;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.viewer-icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border-radius: 50%;
}
.viewer-icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.viewer-room :focus-visible { outline: 2px solid #5b2e6d; outline-offset: 3px; }
.viewer-stage {
  position: relative;
  isolation: isolate;
  min-height: max(240px, 44dvh);
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 30%, #f7effa, #d5b8e3 78%);
}
.viewer-stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #1c1421;
  object-fit: contain;
}
.viewer-caption {
  position: absolute;
  z-index: 1;
  inset: 0 0 auto;
  padding: 14px 16px 38px;
  display: flex;
  align-items: start;
  gap: 9px;
  pointer-events: none;
  background: linear-gradient(#fff9, transparent);
}
.viewer-caption h1 { margin: 1px 0 0; color: #5b2e6d; font-size: clamp(1rem, 4vw, 1.25rem); overflow-wrap: anywhere; }
.viewer-stage:has(video:not([hidden])) .viewer-caption { background: linear-gradient(#1c1421f0, transparent); }
.viewer-stage:has(video:not([hidden])) .viewer-caption h1 { color: #fff; }
.viewer-live-badge { flex: none; padding: 3px 8px; border-radius: 6px; background: #a32139; color: white; font-weight: 800; }
.viewer-count { flex: none; padding: 3px 8px; border-radius: 6px; background: #281a30e8; color: white; font-size: .8rem; }
.viewer-demo-badge { flex: none; padding: 3px 8px; border-radius: 6px; background: #f1e7f5; color: #5b2e6d; font-weight: 700; }
.viewer-empty { z-index: 1; padding: 68px 16px 24px; text-align: center; }
.viewer-empty p { margin-bottom: 12px; }
.viewer-stage:has(.viewer-schedule:not([hidden])) { align-content: center; }
.viewer-stage:has(.viewer-schedule:not([hidden])) .viewer-empty { padding-bottom: 8px; }
.viewer-schedule {
  z-index: 1;
  width: min(100% - 28px, 440px);
  margin: 0 auto 16px;
  padding: 10px 14px;
  border: 1px solid #ba94c9;
  border-radius: 12px;
  background: #fbf6fd;
  color: #5b2e6d;
}
.viewer-schedule h2 { font-size: 1rem; margin: 0 0 4px; }
.viewer-overlay {
  position: absolute;
  z-index: 1;
  inset: auto 0 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 12px 14px;
  pointer-events: none;
}
.viewer-comment-area { min-width: 0; max-width: 390px; }
.viewer-comment-feed {
  display: grid;
  gap: 6px;
  justify-items: start;
  max-height: 23dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
  list-style: none;
  color: #fff;
  padding: 0;
  margin: 0 0 8px;
}
.viewer-comment-feed li {
  display: grid;
  gap: 2px;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 9px;
  background: #281a30e8;
  font-size: .88rem;
  overflow-wrap: anywhere;
  animation: live-comment-fade 11s linear both;
}
.viewer-comment-feed:focus li, .viewer-comment-feed:hover li { animation: none; opacity: 1; }
@keyframes live-comment-fade {
  0% { opacity: 0; transform: translateY(7px); }
  4%, 68% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-5px); }
}
@media (prefers-reduced-motion: reduce) {
  .viewer-comment-feed li { animation: live-comment-fade-still 11s linear both; }
  @keyframes live-comment-fade-still { 0%, 68% { opacity: 1; } 100% { opacity: 0; } }
}
.viewer-comment-feed strong { color: #ebcffa; }
.viewer-comment-feed span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.viewer-comment-button {
  width: 100%;
  min-height: 44px;
  text-align: left;
  padding: 8px 12px;
  border: 1px solid #e4cdeb;
  border-radius: 20px;
  background: #281a30ed;
  color: #fff;
  font: inherit;
  cursor: pointer;
  pointer-events: auto;
}
.viewer-contact-actions { display: grid; gap: 8px; justify-items: center; }
.viewer-contact {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 56px;
  color: #fff;
  text-decoration: none;
  font-size: .73rem;
  font-weight: 700;
  pointer-events: auto;
}
.viewer-contact .viewer-icon-button { color: #5b2e6d; background: #f1e7f5; border: 1px solid #e4cdeb; }
.viewer-contact > span:last-child { padding: 2px 5px; border-radius: 5px; background: #281a30e8; }
.viewer-overlay :focus-visible { outline-color: #fff; }
.viewer-stage:has(video:not([hidden])) .viewer-schedule { display: none; }
.schedule-overview { grid-column: 1 / -1; }
.schedule-list { margin: 0; padding: 0; list-style: none; }
.schedule-list li { display: grid; gap: 4px; padding-block: 8px; overflow-wrap: anywhere; }
.schedule-list li + li { border-top: 1px solid #e8dded; }
.schedule-list time { font-size: .9rem; }
.schedule-list button { justify-self: start; }
.schedule-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.schedule-list a { color: #5b2e6d; }
.viewer-share-status {
  position: absolute;
  z-index: 2;
  bottom: 16px;
  max-width: calc(100% - 32px);
  padding: 9px 12px;
  border-radius: 8px;
  background: #fff;
  color: #35223e;
  overflow-wrap: anywhere;
}
.viewer-actions { display: grid; gap: 8px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.viewer-shortcuts { display: flex; gap: 8px; justify-content: end; flex-wrap: wrap; }
.viewer-product-action {
  display: grid;
  text-align: left;
  min-width: 0;
  min-height: 54px;
  padding: 7px 12px;
  border: 1px solid #ddbb83;
  border-radius: 10px;
  background: #f1e7f5;
  color: #5b2e6d;
  font: inherit;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.viewer-product-action small { font-weight: 700; }
.viewer-sheet {
  position: fixed;
  inset: auto 0 0;
  margin: 0 auto;
  width: min(100%, 560px);
  max-width: 100%;
  max-height: min(72dvh, 650px);
  padding: 0 0 env(safe-area-inset-bottom);
  overflow: auto;
  border: 1px solid #e8dded;
  border-radius: 18px 18px 0 0;
  color: #35223e;
  background: #fff;
}
.viewer-sheet::backdrop { background: #1c142142; }
.viewer-sheet-header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid #e8dded;
}
.viewer-sheet-header h2 { color: #5b2e6d; font-size: 1.15rem; }
.viewer-sheet-body { padding: 8px 16px 18px; overflow-wrap: anywhere; }
.viewer-sheet-body form { display: grid; gap: 8px; margin: 12px 0; }
.viewer-sheet-body input, .viewer-sheet-body select {
  min-width: 0;
  min-height: 44px;
  padding: 8px;
  border: 1px solid #b99dc6;
  border-radius: 8px;
  font: inherit;
  font-size: max(1rem, 16px);
  color: #35223e;
  background: #fff;
}
.viewer-sheet .live-messages { max-height: 24dvh; }
.viewer-sheet-body a { color: #5b2e6d; }
#shopPanel img { display: block; margin-bottom: 8px; }
#guestChallenge { min-width: 0; overflow-x: auto; }
@media (min-width: 640px) {
  .viewer-room { height: 100dvh; }
  .viewer-actions:has(.viewer-product-action:not([hidden])) {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}
@media (max-width: 880px) {
  .live-layout { grid-template-columns: minmax(0, 1fr); }
  .live-backoffice { display: block; }
}

#liveVideo.mirrored { transform: scaleX(-1); }

.live-directory { background: #fff; color: #242424; }
.live-directory .site-header { background: #fff; border-bottom: 1px solid #e7e7e7; }
.live-directory .logo, .live-directory .departments h1, .live-directory .live-panel h2 { color: inherit; }
.live-directory .department, .live-directory .directory-shop {
  border: 0;
  border-radius: 8px;
  background: #f3f3f3;
  color: #242424;
}
.live-directory .department:hover, .live-directory .directory-shop:hover { background: #e8e8e8; }
.live-directory .schedule-overview { border: 0; border-top: 1px solid #e7e7e7; border-radius: 0; }

.camera-button .control-slash, #soundToggle .sound-off, #soundToggle[aria-pressed="true"] .sound-on { display: none; }
.camera-button[aria-pressed="true"] .control-slash, #soundToggle[aria-pressed="true"] .sound-off { display: inline; }
.live-share { position: absolute; inset: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) auto auto; z-index: 3; }
.viewer-caption { flex-wrap: wrap; padding-right: 64px; }
#departmentCart { position: relative; }
#viewerCartCount { position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; border-radius: 9px; background: #fff; color: #1e1e1e; font: 700 .72rem/18px system-ui; text-align: center; }
.viewer-watching { overflow: hidden; background: #151515; }
.viewer-watching .viewer-room { display: block; max-width: none; height: 100dvh; background: #151515; }
.viewer-watching .viewer-header, .viewer-watching .viewer-caption h1 { display: none; }
.viewer-watching .viewer-stage { position: fixed; inset: 0; width: 100%; height: 100dvh; border: 0; border-radius: 0; background: #151515; }
.viewer-watching .viewer-stage video { width: 100%; height: 100%; object-fit: contain; }
.viewer-watching .viewer-caption { padding-top: max(16px, env(safe-area-inset-top)); }
.viewer-watching .viewer-overlay { bottom: calc(76px + env(safe-area-inset-bottom)); }
.viewer-watching .viewer-actions {
  position: fixed;
  z-index: 3;
  inset: auto 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, #000b);
  pointer-events: none;
}
.viewer-watching .viewer-actions button, .viewer-watching .viewer-actions a { pointer-events: auto; }
.viewer-watching .viewer-shortcuts { margin-inline-start: auto; }
.live-composer { position: relative; pointer-events: auto; min-width: 0; }
.composer-row {
  display: flex;
  align-items: center;
  min-width: 0;
  padding-inline: 4px;
  border-radius: 24px;
  background: #181818e8;
  color: #fff;
}
.composer-row input { flex: 1; min-width: 0; height: 44px; padding: 0 4px 0 10px; border: 0; background: transparent; color: #fff; font: inherit; font-size: 1rem; }
.composer-row input::placeholder { color: #d2d2d2; }
.composer-row .composer-icon { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: #fff; cursor: pointer; }
.composer-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.composer-icon:disabled { opacity: .5; }
.composer-row :focus-visible { outline-color: #fff; outline-offset: -3px; }
.composer-popover, .composer-status:not(:empty) { padding: 6px 10px; border-radius: 10px; background: #181818ed; color: #fff; }
.composer-popover { position: absolute; bottom: 100%; inset-inline: 0; margin-bottom: 4px; }
.composer-popover button { min-height: 36px; padding: 4px; background: transparent; color: inherit; border: 0; cursor: pointer; }
.composer-emojis { display: flex; flex-wrap: wrap; gap: 2px; }
.composer-emojis button { min-width: 32px; font-size: 1.12rem; }
.composer-status { margin: 4px 0 0; font-size: .8rem; }
.composer-status:empty { display: none; }
.viewer-name-sheet { max-width: 360px; }
.viewer-name-sheet #guestNameForm { display: grid; gap: 8px; }
.viewer-name-sheet input { min-height: 44px; padding: 0 10px; font-size: 1rem; }
.viewer-watching .viewer-overlay { bottom: max(calc(76px + env(safe-area-inset-bottom)), calc(var(--comment-keyboard-inset, 0px) + 12px)); }
