*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Global safety net: several controls below set `display` unconditionally (e.g.
   .sp-ctrl { display: grid }), which otherwise beats the UA [hidden] default and
   leaves them visible — see #toggleScreen, always hidden/disabled today. */
[hidden] {
  display: none !important;
}

:root {
  --ink: #1a1a1a;
  --ink-dim: #6b7280;
  --paper: #f5f5f7;
  --white: #ffffff;
  --yellow: #ffcc00;
  --yellow-deep: #f0c000;
  --yellow-soft: #fff3b0;
  --navy: #1a2b5a;
  --navy-deep: #111827;
  --red: #c8102e;
  --red-deep: #a50d25;
  --ok: #22c55e;
  --amber: #b8893d;
  --border: rgba(26, 26, 26, 0.12);
  --radius: 14px;
  --radius-lg: 20px;
  --header-h: 64px;
  --font: "Montserrat", "Arial Narrow", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 18px 48px rgba(17, 24, 39, 0.1);
  --shadow-soft: 0 8px 28px rgba(17, 24, 39, 0.08);
  --lobby-max: 720px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  font-family: var(--font);
  font-size-adjust: from-font;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea,
.btn {
  font-family: var(--font);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.container {
  width: min(1120px, 100% - 32px);
  margin-inline: auto;
}

.sp-skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 500;
  padding: 10px 14px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 700;
  border-radius: 8px;
}

.sp-skip:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Sticky stack: banners sit above the header (avoid overlapping top:0). */
.sp-secure-banner {
  display: none;
  background: var(--red);
  color: #fff;
  text-align: center;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 420;
}

.sp-secure-banner:not([hidden]) {
  display: block;
}

.sp-secure-banner a {
  color: #fff;
  text-decoration: underline;
  margin-left: 8px;
}

.sp-resilience-banner {
  display: none;
  background: #1f2a37;
  color: #f8fafc;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 410;
}

.sp-resilience-banner:not([hidden]) {
  display: block;
}

body:has(#secureBanner:not([hidden])) .sp-resilience-banner {
  top: 44px;
}

.sp-resilience-banner[data-level="warn"] {
  background: #7a4b00;
}

.sp-resilience-banner[data-level="error"] {
  background: #8b1520;
}

/* Header — Telemost-light */
.sp-header {
  position: sticky;
  top: 0;
  z-index: 300;
  height: var(--header-h);
  background: rgba(245, 245, 247, 0.92);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

body:has(#secureBanner:not([hidden])) .sp-header {
  top: 44px;
}

body:has(#resilienceBanner:not([hidden])) .sp-header {
  top: 38px;
}

body:has(#secureBanner:not([hidden])):has(#resilienceBanner:not([hidden])) .sp-header {
  top: 82px;
}

.sp-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
}

.sp-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sp-logo__star {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.sp-logo__mark {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
}

.sp-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sp-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--ink);
  max-width: min(42ch, 48vw);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-live-pill__dot,
.sp-hero__live-dot,
.sp-hero__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  flex-shrink: 0;
  animation: sp-pulse 2s ease infinite;
}

.sp-live-pill.is-quiet .sp-live-pill__dot,
.sp-hero__live.is-quiet .sp-hero__live-dot,
.sp-hero__status.is-quiet .sp-hero__status-dot {
  background: #9ca3af;
  animation: none;
}

@keyframes sp-pulse {
  0%,
  100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.sp-hotline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  white-space: nowrap;
}

.sp-hotline svg {
  color: var(--ink-dim);
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 14px;
  font-weight: 750;
  font-size: 0.95rem;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s var(--ease), background 0.2s, box-shadow 0.2s;
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    transform: translateY(-1px);
  }
}

.btn--accent {
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(255, 204, 0, 0.35);
}

.btn--accent:hover {
  background: var(--yellow-deep);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn--lg {
  padding: 16px 28px;
  font-size: 1.05rem;
  min-width: min(100%, 320px);
  border-radius: 16px;
}

.btn--sm {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.btn[aria-busy="true"] {
  opacity: 0.85;
  cursor: wait;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Lobby (Telemost join screen) */
.sp-lobby {
  padding: 28px 0 48px;
  /* Soft flag wash under the Telemost lobby (readable paper overlay). */
  background-color: var(--paper);
  background-image:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 255, 255, 0.92) 0%, transparent 55%),
    linear-gradient(180deg, rgba(245, 245, 247, 0.86) 0%, rgba(245, 245, 247, 0.96) 100%),
    url("assets/hero-flag.jpg");
  background-image:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 255, 255, 0.92) 0%, transparent 55%),
    linear-gradient(180deg, rgba(245, 245, 247, 0.86) 0%, rgba(245, 245, 247, 0.96) 100%),
    image-set(
      url("assets/hero-flag.webp") type("image/webp"),
      url("assets/hero-flag.jpg") type("image/jpeg")
    );
  background-position: center, center, center 18%;
  background-size: auto, auto, cover;
  background-repeat: no-repeat;
}

.sp-lobby__inner {
  width: min(var(--lobby-max), 100% - 32px);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.sp-lobby-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  background: #1a2336;
}

.sp-lobby-preview__scene {
  position: absolute;
  inset: 0;
}

.sp-lobby-preview__scene img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  /* Soft Telemost-like wash over the same hero photo as the previous portal. */
  transform: scale(1.04);
  filter: saturate(0.92) brightness(1.04);
}

.sp-lobby-preview__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(17, 24, 39, 0.08) 42%, rgba(17, 24, 39, 0.42) 100%),
    linear-gradient(90deg, rgba(17, 24, 39, 0.12), transparent 40%, rgba(17, 24, 39, 0.1));
  pointer-events: none;
}

.sp-lobby-preview__bar {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.1);
  pointer-events: none;
  user-select: none;
}

.sp-lobby-preview__bar--deco {
  opacity: 0.72;
}

.sp-lobby-preview__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(26, 26, 26, 0.22);
}

.sp-lobby-preview__dot--accent {
  background: rgba(200, 16, 46, 0.55);
  width: 12px;
  height: 12px;
}

.sp-lobby__title {
  font-size: clamp(1.75rem, 3.6vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 8px;
}

.sp-lobby__lead {
  font-size: 1.05rem;
  color: var(--ink-dim);
  margin-bottom: 22px;
}

/* chips → CTA → callback (Telemost join order). Radiogroup is a real box
   (not display:contents) so AT sees aria-label; callback joins via aria-owns. */
.sp-lobby__controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  width: 100%;
  margin-bottom: 8px;
}

.sp-channels__radiogroup {
  display: block;
  width: 100%;
}

.sp-channels__chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.sp-connect-actions {
  width: 100%;
  display: flex;
  justify-content: center;
}

.sp-connect-actions .btn--lg {
  width: 100%;
}

.sp-channel-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 10px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s var(--ease);
  min-height: 52px;
  width: 100%;
}

.sp-channel-card__main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sp-channel-card__icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
  opacity: 0.85;
}

.sp-channel-card__label {
  font-size: 0.95rem;
}

.sp-channel-card.is-selected {
  background: var(--yellow-soft);
  border-color: var(--yellow);
  box-shadow: 0 0 0 1px rgba(255, 204, 0, 0.35);
}

@media (hover: hover) and (pointer: fine) {
  .sp-channel-card:hover {
    border-color: rgba(255, 204, 0, 0.65);
    transform: translateY(-1px);
  }
}

@media (hover: none), (pointer: coarse) {
  .sp-channel-card:active:not(.is-selected) {
    border-color: rgba(255, 204, 0, 0.55);
    background: #fffdf0;
  }
}

.sp-channel-card--callback {
  width: auto;
  min-width: 44px;
  justify-self: center;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink-dim);
  font-weight: 650;
  font-size: 0.92rem;
  /* Keep text-link look with ≥44px touch target (WCAG 2.5.5 / mobile). */
  min-height: 44px;
  padding: 12px 16px;
}

.sp-channel-card--callback.is-selected {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sp-channel-card--callback:hover {
  transform: none;
  border: 0;
  color: var(--ink);
}

.sp-channel-card__badge {
  display: none;
  margin: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  background: rgba(184, 137, 61, 0.16);
  color: #8a6424;
}

.sp-channel-card__badge:not([hidden]) {
  display: inline-block;
}

.sp-callback-hint {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--ink-dim);
}

.sp-preauth {
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  max-width: none;
  width: 100%;
}

.sp-preauth__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sp-preauth__field {
  position: relative;
  text-align: left;
}

.sp-preauth__field label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-dim);
}

.sp-preauth__icon {
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: 18px;
  height: 18px;
  color: var(--ink-dim);
  pointer-events: none;
  display: grid;
  place-items: center;
}

.sp-preauth__icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.sp-preauth__field input {
  width: 100%;
  padding: 14px 14px 14px 42px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  font: inherit;
  background: var(--white);
  color: var(--ink);
}

.sp-preauth__field input::placeholder {
  /* ~4.6:1 on white — AA for placeholder text when labels are also visible */
  color: #6b7280;
}

.sp-preauth__field input:focus {
  outline: 2px solid rgba(255, 204, 0, 0.75);
  border-color: var(--yellow);
}

.sp-preauth__field input[aria-invalid="true"] {
  border-color: var(--red);
  outline-color: var(--red);
}

.sp-channel-card:focus-visible,
.sp-ctrl:focus-visible,
.sp-fab__main:focus-visible,
.sp-fab__option:focus-visible,
.sp-portal-auth__btn:focus-visible,
.sp-chat-input button:focus-visible,
.sp-hotline:focus-visible,
.sp-logo:focus-visible,
.btn:focus-visible,
#sessionStatus:focus-visible {
  outline: 3px solid rgba(255, 204, 0, 0.85);
  outline-offset: 2px;
}

.sp-portal-auth {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  text-align: left;
}

.sp-portal-auth__lead {
  margin: 10px 0 8px;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--ink-dim);
  text-align: center;
}

.sp-portal-auth__opt {
  font-weight: 500;
  opacity: 0.85;
}

.sp-portal-auth__consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--ink-dim);
  cursor: pointer;
}

.sp-portal-auth__consent input {
  margin-top: 3px;
  flex-shrink: 0;
}

.sp-portal-auth__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.sp-portal-auth__btn {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  padding: 8px 12px;
  border-radius: var(--radius);
  cursor: pointer;
}

.sp-portal-auth__btn:hover:not(:disabled) {
  border-color: var(--yellow);
}

.sp-portal-auth__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sp-portal-auth__tg {
  display: flex;
  justify-content: center;
  margin-top: 8px;
  min-height: 0;
}

.sp-portal-auth__badge {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: rgba(34, 120, 80, 0.1);
  color: #1f6b48;
  font-size: 0.82rem;
  font-weight: 650;
  text-align: center;
}

.sp-portal-auth__clear {
  display: block;
  margin: 10px auto 0;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-dim);
  font: inherit;
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
}

.sp-form-err {
  margin-top: 12px;
  text-align: center;
  color: var(--red);
  font-weight: 700;
  font-size: 0.9rem;
}

.sp-email-autostart {
  margin: 16px auto 0;
  max-width: 520px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 204, 0, 0.45);
  background: rgba(255, 204, 0, 0.12);
  text-align: center;
}

.sp-email-autostart__lead {
  margin: 0 0 12px;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.4;
}

.sp-email-autostart[hidden] {
  display: none !important;
}

.sp-lobby__footnote {
  margin-top: 22px;
  font-size: 0.82rem;
  color: var(--ink-dim);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.sp-lobby__footnote a {
  color: var(--ink-dim);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sp-lobby__footnote-sep {
  opacity: 0.5;
}

/* Session */
.sp-section-head {
  margin-bottom: 28px;
  text-align: center;
}

.sp-section-title {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.sp-section-sub {
  color: var(--ink-dim);
  max-width: 48ch;
  margin-inline: auto;
}

.sp-section-sub a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sp-session {
  /* Consultation stage sits at the top of <main> (above the join lobby). */
  padding: 20px 0 36px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.sp-session .sp-section-head {
  margin-bottom: 18px;
}

.sp-session__layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 18px;
  align-items: start;
}

.sp-video-panel {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #1f2937;
  aspect-ratio: 16 / 10;
  position: relative;
  border: 1px solid rgba(18, 24, 38, 0.08);
  box-shadow: var(--shadow-soft);
}

.sp-video-panel__remote {
  width: 100%;
  height: 100%;
  position: relative;
  display: grid;
  place-items: center;
  /* Soft vignette over hero — same photo as previous portal (voice / idle stage). */
  background-color: #1a2336;
  background-image:
    radial-gradient(120% 90% at 50% 40%, rgba(12, 18, 32, 0.18) 0%, rgba(12, 18, 32, 0.62) 72%, rgba(7, 11, 20, 0.78) 100%),
    url("assets/hero-soldiers.jpg");
  background-image:
    radial-gradient(120% 90% at 50% 40%, rgba(12, 18, 32, 0.18) 0%, rgba(12, 18, 32, 0.62) 72%, rgba(7, 11, 20, 0.78) 100%),
    image-set(
      url("assets/hero-soldiers.webp") type("image/webp"),
      url("assets/hero-soldiers.jpg") type("image/jpeg")
    );
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.sp-video-panel__remote-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 24px 88px;
  text-align: center;
  color: #fff;
  background: transparent;
  pointer-events: none;
}

.sp-video-panel__remote-placeholder > #sessionStatus,
.sp-video-panel__remote-placeholder > #sessionHint,
.sp-video-panel__remote-placeholder > #mediaRetryBtn {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.sp-video-panel__remote-placeholder > #sessionStatus {
  margin: 0;
  max-width: min(28ch, 90%);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
  color: #fff;
  background: rgba(17, 24, 39, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 28px rgba(7, 11, 20, 0.28);
}

.sp-session-hint {
  max-width: 32ch;
  margin: 0;
  padding: 8px 12px;
  border-radius: calc(var(--radius) - 2px);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  line-height: 1.4;
  background: rgba(12, 18, 32, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.sp-session-hint[hidden],
#mediaRetryBtn[hidden] {
  display: none !important;
}

.sp-remote-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
  z-index: 0;
}

.sp-remote-video[hidden],
.sp-remote-video.sp-remote-video--audio {
  display: none !important;
}

.sp-session[data-phase="error"] .sp-video-panel__remote-placeholder > #sessionStatus {
  background: rgba(120, 18, 36, 0.62);
  border-color: rgba(255, 180, 190, 0.35);
}

.sp-session[data-phase="connecting"] .sp-video-panel__remote-placeholder > #sessionStatus,
.sp-session[data-phase="queued"] .sp-video-panel__remote-placeholder > #sessionStatus {
  background: rgba(26, 43, 90, 0.58);
  border-color: rgba(190, 210, 255, 0.28);
}

.sp-session[data-phase="queued"] .sp-video-panel__remote-placeholder::after,
.sp-session[data-phase="connecting"] .sp-video-panel__remote-placeholder::after {
  content: '';
  position: absolute;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.28);
  animation: sp-queue-pulse 1.8s ease-out infinite;
  pointer-events: none;
  top: calc(50% - 92px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.sp-session[data-phase="live"] .sp-video-panel__remote-placeholder > #sessionStatus {
  background: rgba(20, 72, 48, 0.58);
  border-color: rgba(160, 230, 190, 0.35);
}

.sp-session[data-phase="ended"] .sp-video-panel__remote-placeholder > #sessionStatus {
  background: rgba(18, 24, 38, 0.55);
  border-color: rgba(255, 255, 255, 0.2);
}

.sp-session[data-phase="live"] #secureLabel {
  color: #14603c;
}

.sp-timer[data-timer-mode="wait"] #callTimer {
  color: #8a5a00;
  font-weight: 700;
}

.sp-timer[data-timer-mode="talk"] #callTimer {
  color: #14603c;
  font-weight: 700;
}

.sp-video-panel[data-channel="voice"] .sp-video-panel__local,
.sp-video-panel[data-channel="chat"] .sp-video-panel__local,
.sp-video-panel[data-channel="callback"] .sp-video-panel__local {
  display: none;
}

@keyframes sp-queue-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35); opacity: 0.9; }
  70% { box-shadow: 0 0 0 22px rgba(255, 255, 255, 0); opacity: 0.35; }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); opacity: 0; }
}

.sp-video-panel__local {
  position: absolute;
  /* Sit above the floating control pill (~68px) so PiP never covers End/mic. */
  bottom: 84px;
  right: 16px;
  width: 132px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: #1a2336;
  border: 2px solid rgba(255, 255, 255, 0.28);
  overflow: hidden;
  z-index: 2;
}

.sp-video-panel__controls {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 14px;
  display: flex;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.22);
  width: max-content;
  max-width: calc(100% - 24px);
}

.sp-ctrl {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(26, 26, 26, 0.06);
  color: var(--ink);
}

@media (hover: hover) and (pointer: fine) {
  .sp-ctrl:hover {
    background: rgba(26, 26, 26, 0.12);
  }
}

.sp-ctrl:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sp-ctrl--off {
  background: rgba(200, 16, 46, 0.9);
  color: #fff;
}

.sp-ctrl--end {
  background: var(--red);
  color: #fff;
  width: auto;
  min-width: 48px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
}

.sp-ctrl svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.sp-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sp-sidebar-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.sp-sidebar-card__title {
  font-size: 15px;
  font-weight: 800;
  margin: 14px 0 10px;
}

.sp-operator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.sp-operator__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.sp-operator[data-state="waiting"] .sp-operator__avatar {
  background: var(--paper);
  color: var(--ink-dim);
}

.sp-operator[data-state="assigned"] .sp-operator__avatar {
  background: var(--yellow);
  color: var(--ink);
}

.sp-operator__info strong {
  display: block;
  font-size: 0.95rem;
}

.sp-operator__info span {
  font-size: 0.8rem;
  color: var(--ink-dim);
}

.sp-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--paper);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--ink-dim);
}

.sp-timer__sep {
  opacity: 0.5;
}

.sp-chat-preview {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  scroll-behavior: smooth;
}

.sp-msg {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  max-width: 90%;
  line-height: 1.4;
}

.sp-msg--in {
  background: #f3f4f6;
  align-self: flex-start;
}

.sp-msg--out {
  background: var(--yellow);
  color: var(--ink);
  align-self: flex-end;
}

.sp-msg--sys {
  align-self: center;
  background: transparent;
  color: var(--ink-dim);
  font-size: 12px;
  text-align: center;
  max-width: 100%;
}

.sp-msg--pending {
  opacity: 0.72;
  box-shadow: inset 0 0 0 1px rgba(26, 26, 26, 0.12);
}

.sp-msg--typing {
  font-style: italic;
}

.sp-chat-input {
  display: flex;
  gap: 8px;
}

.sp-chat-input input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font: inherit;
  font-size: 0.85rem;
}

.sp-chat-input input:focus {
  outline: 2px solid rgba(255, 204, 0, 0.7);
  border-color: var(--yellow);
}

.sp-chat-input button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  font-size: 1rem;
  flex-shrink: 0;
}

.sp-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sp-checklist li {
  display: flex;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--ink-dim);
}

.sp-checklist li::before {
  content: "✓";
  color: var(--ok);
  font-weight: 800;
}

.sp-footer {
  padding: 28px 0;
  color: rgba(232, 228, 220, 0.78);
  font-size: 0.85rem;
  background-color: var(--navy-deep);
  background-image:
    linear-gradient(180deg, rgba(17, 24, 39, 0.94) 0%, rgba(17, 24, 39, 0.97) 100%),
    url("assets/hero-flag.jpg");
  background-image:
    linear-gradient(180deg, rgba(17, 24, 39, 0.94) 0%, rgba(17, 24, 39, 0.97) 100%),
    image-set(
      url("assets/hero-flag.webp") type("image/webp"),
      url("assets/hero-flag.jpg") type("image/jpeg")
    );
  background-position: center, center 40%;
  background-size: auto, cover;
  background-repeat: no-repeat;
}

.sp-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.sp-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.sp-footer a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sp-fab {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  right: calc(24px + env(safe-area-inset-right, 0px));
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.sp-fab__menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.sp-fab.is-open .sp-fab__menu {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.sp-fab__option {
  padding: 10px 16px;
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  font-size: 0.85rem;
  font-weight: 700;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.sp-fab__main {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(255, 204, 0, 0.45);
  overflow: visible;
}

.sp-fab__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255, 204, 0, 0.4);
  animation: sp-fab-pulse 2.2s var(--ease) infinite;
  pointer-events: none;
  z-index: 0;
}

.sp-fab__icon {
  position: relative;
  z-index: 1;
  display: block;
}

.sp-fab__icon--call {
  transform-origin: 50% 50%;
  animation: sp-fab-ring 2.2s var(--ease) infinite;
}

.sp-fab__icon--close {
  display: none;
}

.sp-fab.is-open .sp-fab__main {
  background: var(--navy-deep);
  color: #fff;
  box-shadow: 0 10px 28px rgba(12, 18, 32, 0.4);
}

.sp-fab.is-open .sp-fab__pulse {
  animation: none;
  opacity: 0;
}

.sp-fab.is-open .sp-fab__icon--call {
  display: none;
  animation: none;
}

.sp-fab.is-open .sp-fab__icon--close {
  display: block;
}

@keyframes sp-fab-pulse {
  0% { transform: scale(1); opacity: 0.55; }
  70% { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}

@keyframes sp-fab-ring {
  0%, 100% { transform: rotate(0deg); }
  8% { transform: rotate(14deg); }
  16% { transform: rotate(-12deg); }
  24% { transform: rotate(10deg); }
  32% { transform: rotate(-6deg); }
  40% { transform: rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .sp-fab__pulse,
  .sp-fab__icon--call,
  .sp-live-pill__dot,
  .sp-session[data-phase="queued"] .sp-video-panel__remote-placeholder::after,
  .sp-session[data-phase="connecting"] .sp-video-panel__remote-placeholder::after {
    animation: none !important;
  }

  html {
    scroll-behavior: auto;
  }

  .btn,
  .sp-channel-card,
  .sp-fab__menu,
  .sp-ctrl {
    transition: none !important;
  }

  .btn:hover,
  .sp-channel-card:hover,
  .sp-channel-card.is-selected {
    transform: none !important;
  }

  .sp-lobby-preview__scene img {
    transform: none;
    filter: none;
  }
}

@media (max-width: 1024px) {
  .sp-session__layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sp-hotline span {
    display: none;
  }

  .sp-live-pill {
    max-width: 46vw;
    font-size: 0.75rem;
    padding: 7px 10px;
  }

  .sp-logo__mark {
    font-size: 0.78rem;
  }

  .sp-lobby {
    padding-top: 16px;
  }

  .sp-lobby-preview {
    aspect-ratio: 4 / 3;
    border-radius: 18px;
  }

  .sp-lobby__controls {
    gap: 8px;
  }

  .sp-channels__chips {
    grid-template-columns: 1fr;
  }

  .sp-preauth__grid {
    grid-template-columns: 1fr;
  }

  .sp-video-panel {
    aspect-ratio: 4 / 5;
  }

  .sp-video-panel__local {
    width: 96px;
    bottom: 80px;
    right: 12px;
  }
}

@media (max-width: 420px) {
  .sp-live-pill {
    display: none;
  }
}
