/* Google Material–style traffic modal (design aligned with googlemeet-panel) */

:root {
  --gmp-blue: #4285f4;
  --gmp-red: #ea4335;
  --gmp-yellow: #fbbc04;
  --gmp-green: #34a853;
  --gmp-primary: #1a73e8;
  --gmp-primary-hover: #1557b0;
}

#hl-traffic-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  font-family: "Google Sans", Roboto, Arial, sans-serif;
}

#hl-traffic-overlay[hidden] {
  display: none;
}

.hl-traffic-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(32, 33, 36, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: hl-traffic-fade-in 0.28s ease;
}

.hl-traffic-dialog {
  position: relative;
  z-index: 1;
  flex: 0 1 auto;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  background-color: #fff;
  background-image: linear-gradient(
    90deg,
    var(--gmp-blue) 0%,
    var(--gmp-blue) 24%,
    var(--gmp-red) 24%,
    var(--gmp-red) 48%,
    var(--gmp-yellow) 48%,
    var(--gmp-yellow) 72%,
    var(--gmp-green) 72%,
    var(--gmp-green) 100%
  );
  background-size: 100% 4px;
  background-repeat: no-repeat;
  background-position: top center;
  border: none;
  border-radius: 28px;
  box-shadow:
    0 1px 2px rgba(60, 64, 67, 0.3),
    0 2px 6px 2px rgba(60, 64, 67, 0.15);
  padding: 36px 40px 40px;
  text-align: center;
  animation: hl-traffic-dialog-in 0.55s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.hl-traffic-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #444746;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease;
}

.hl-traffic-close:hover {
  background: rgba(68, 71, 70, 0.08);
  color: #444746;
}

/* —— Init view header —— */
.hl-init-brand-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0 auto 20px;
  border: none;
  border-radius: 0;
  background: transparent;
}

.hl-init-brand-box--sm {
  margin-bottom: 16px;
}

.hl-init-brand-img {
  display: block;
  width: auto;
  height: 40px;
  max-width: min(100%, 280px);
  margin: 0 auto;
}

.hl-init-brand-box--sm .hl-init-brand-img {
  height: 32px;
  max-width: min(100%, 240px);
}

.hl-init-brand-svg {
  display: block;
  width: 150px;
  height: 28px;
  color: #0b57d0;
}

.hl-init-brand-box--sm .hl-init-brand-svg {
  width: 130px;
  height: 24px;
}

.hl-init-heading {
  margin: 0 0 8px;
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.75rem;
  letter-spacing: 0;
  color: #414141;
  -webkit-font-smoothing: antialiased;
}

.hl-init-tagline {
  margin: 0 0 24px;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.375rem;
  color: #5f6368;
}

.hl-init-session {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 6px 14px;
  border: 1px solid #dadce0;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: #444746;
  font-variant-numeric: tabular-nums;
}

.hl-init-session-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: conic-gradient(
    var(--gmp-blue),
    var(--gmp-red),
    var(--gmp-yellow),
    var(--gmp-green),
    var(--gmp-blue)
  );
  box-shadow: none;
}

/* —— Step timeline —— */
.hl-init-steps {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  text-align: left;
}

.hl-init-step {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  padding-bottom: 18px;
}

.hl-init-step:last-child {
  padding-bottom: 0;
}

.hl-init-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 44px;
  bottom: 0;
  width: 2px;
  border-radius: 1px;
  background: #e8eaed;
}

.hl-init-step.is-done:not(:last-child)::before {
  background: linear-gradient(
    180deg,
    var(--gmp-green) 0%,
    #e8eaed 100%
  );
}

.hl-init-step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #eee;
  color: #252525;
  flex-shrink: 0;
}

.hl-init-step.is-done .hl-init-step-icon {
  background: #e6f4ea;
  color: var(--gmp-green);
}

.hl-init-step.is-active .hl-init-step-icon {
  background: #f8f9fa;
  box-shadow: inset 0 0 0 2px rgba(52, 168, 83, 0.35);
}

.hl-init-step.is-error .hl-init-step-icon {
  background: #fce8e6;
  color: #c5221f;
}

.hl-init-step.is-pending {
  display: none;
}

.hl-init-step-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid #e8eaed;
  border-top-color: var(--gmp-blue);
  border-radius: 50%;
  animation: hl-init-spin 0.8s linear infinite;
}

.hl-init-step-title {
  margin: 0 0 4px;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.375rem;
  color: #414141;
  -webkit-font-smoothing: antialiased;
}

.hl-init-step-meta {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.25rem;
  color: #5f6368;
  font-variant-numeric: tabular-nums;
}

.hl-init-step-badge {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 8px 2px 6px;
  border-radius: 4px;
  border-left: 3px solid var(--gmp-blue);
  background: #f8f9fa;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #5f6368;
}

/* —— Final notice + CTA —— */
.hl-init-notice {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid #dadce0;
  border-radius: 12px;
  background: #f8f9fa;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.375rem;
  color: #444746;
  text-align: left;
}

.hl-init-notice[hidden],
.hl-init-start[hidden],
.hl-verify-view[hidden],
.hl-init-view[hidden],
.hl-bind-view[hidden] {
  display: none;
}

.hl-traffic-dialog.hl-traffic-dialog--bind {
  max-width: 560px;
  padding: 24px 28px 40px;
}

.hl-init-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 300px;
  min-height: 48px;
  margin: 4px auto 0;
  padding: 0 28px;
  border: none;
  border-radius: 9999px;
  background: var(--gmp-primary);
  color: #fff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
}

.hl-init-start:hover {
  background: var(--gmp-primary-hover);
  box-shadow:
    0 1px 2px rgba(60, 64, 67, 0.3),
    0 1px 3px 1px rgba(60, 64, 67, 0.15);
  transform: translateY(-1px);
}

.hl-init-start:active {
  transform: scale(0.97);
}

.hl-init-start svg {
  flex-shrink: 0;
  color: #fff;
}

/* —— Verify view (high traffic) —— */
.hl-verify-view,
.hl-init-view,
.hl-bind-view {
  overflow: visible;
}

.hl-verify-view {
  text-align: center;
}

/* Init view is the tallest step — keep compact so no scroll is needed */
.hl-traffic-dialog:has(#hl-init-view:not([hidden])) {
  padding: 20px 32px 24px;
}

.hl-init-view .hl-init-brand-box {
  margin-bottom: 12px;
}

.hl-init-view .hl-init-brand-img {
  height: 32px;
}

.hl-init-view .hl-init-heading {
  margin-bottom: 6px;
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.75rem;
}

.hl-init-view .hl-init-tagline {
  margin-bottom: 14px;
  font-size: 0.875rem;
  line-height: 1.375rem;
}

.hl-init-view .hl-init-session {
  margin-bottom: 10px;
  padding: 4px 10px;
}

.hl-init-view .hl-init-steps {
  margin-bottom: 10px;
}

.hl-init-view .hl-init-step {
  grid-template-columns: 34px 1fr;
  gap: 10px;
  padding-bottom: 8px;
}

.hl-init-view .hl-init-step:not(:last-child)::before {
  left: 16px;
  top: 34px;
  width: 1px;
}

.hl-init-view .hl-init-step-icon {
  width: 34px;
  height: 34px;
}

.hl-init-view .hl-init-step-icon svg {
  width: 14px;
  height: 14px;
}

.hl-init-view .hl-init-step-spinner {
  width: 14px;
  height: 14px;
}

.hl-init-view .hl-init-step-title {
  margin-bottom: 1px;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.25rem;
}

.hl-init-view .hl-init-step-meta {
  font-size: 0.6875rem;
  line-height: 1.1rem;
}

.hl-init-view .hl-init-step-badge {
  margin-bottom: 3px;
  padding: 1px 6px 1px 5px;
  font-size: 0.5625rem;
}

.hl-init-view .hl-init-notice {
  margin-bottom: 10px;
  padding: 10px 12px;
  font-size: 0.8125rem;
  line-height: 1.25rem;
}

.hl-init-view .hl-init-start {
  min-height: 40px;
  margin-top: 0;
}

@media (max-height: 720px) {
  .hl-traffic-dialog:has(#hl-init-view:not([hidden])) {
    padding: 14px 24px 18px;
  }

  .hl-init-view .hl-init-brand-img {
    height: 22px;
  }

  .hl-init-view .hl-init-heading {
    font-size: 1.25rem;
    line-height: 1.5rem;
  }

  .hl-init-view .hl-init-tagline {
    margin-bottom: 8px;
    font-size: 0.8125rem;
    line-height: 1.2rem;
  }

  .hl-init-view .hl-init-session {
    margin-bottom: 6px;
  }

  .hl-init-view .hl-init-steps {
    margin-bottom: 8px;
  }

  .hl-init-view .hl-init-step {
    padding-bottom: 5px;
  }

  .hl-init-view .hl-init-notice {
    margin-bottom: 8px;
    padding: 8px 10px;
    font-size: 0.75rem;
    line-height: 1.15rem;
  }
}

.hl-verify-title {
  margin: 0 auto 10px;
  max-width: 17.5rem;
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.75rem;
  letter-spacing: 0;
  color: #414141;
  -webkit-font-smoothing: antialiased;
}

.hl-verify-body {
  margin: 0 auto 32px;
  max-width: 18.75rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.375rem;
  color: #5f6368;
}

.hl-verify-body strong {
  color: #414141;
  font-weight: 400;
}

.hl-verify-remember {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 24px;
  cursor: pointer;
  user-select: none;
}

.hl-verify-remember input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--gmp-blue);
  cursor: pointer;
}

.hl-verify-remember span {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.25rem;
  color: #444746;
}

.hl-verify-submit {
  width: 100%;
  max-width: 300px;
  min-height: 48px;
  padding: 0 28px;
  border: none;
  border-radius: 9999px;
  background: var(--gmp-primary);
  color: #fff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
}

.hl-verify-submit:hover {
  background: var(--gmp-primary-hover);
  box-shadow:
    0 1px 2px rgba(60, 64, 67, 0.3),
    0 1px 3px 1px rgba(60, 64, 67, 0.15);
  transform: translateY(-1px);
}

.hl-verify-submit:active {
  transform: scale(0.97);
}

.hl-verify-submit:disabled {
  opacity: 0.7;
  cursor: default;
  transform: none;
}

/* —— Manual binding view —— */
.hl-bind-view {
  text-align: center;
}

.hl-bind-view:not([hidden]) {
  padding-bottom: 4px;
}

.hl-bind-heading,
.hl-bind-device-line {
  text-align: left;
}

.hl-bind-heading {
  margin: 0 0 14px;
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.75rem;
  letter-spacing: 0;
  color: #414141;
  -webkit-font-smoothing: antialiased;
}

.hl-bind-device-line {
  margin: 0 0 22px;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.375rem;
  color: #5f6368;
  white-space: nowrap;
}

.hl-bind-device-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 2px;
  padding: 3px 10px 3px 8px;
  border: 1px solid #dadce0;
  border-radius: 999px;
  background: #f8f9fa;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #202124;
  vertical-align: middle;
}

.hl-bind-device-pill svg {
  display: block;
  flex-shrink: 0;
  color: #5f6368;
}

.hl-bind-steps {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0 0 24px;
  text-align: left;
}

.hl-bind-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.hl-bind-num {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin-top: 1px;
  border: none;
  border-radius: 50%;
  background: #eee;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  color: #5f6368;
}

.hl-bind-text {
  margin: 0;
  padding-top: 6px;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.375rem;
  color: #5f6368;
  white-space: nowrap;
}

.hl-bind-text strong {
  font-weight: 500;
  color: #414141;
}

.hl-bind-text kbd {
  display: inline-block;
  padding: 2px 6px;
  margin: 0;
  font-family: "Google Sans", Roboto, Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25rem;
  color: #202124;
  background: #f1f3f4;
  border: 1px solid #dadce0;
  border-radius: 6px;
  vertical-align: baseline;
}

.hl-bind-text .hl-bind-kbd-win {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 2px 6px;
  vertical-align: middle;
}

.hl-bind-verify {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 300px;
  min-height: 48px;
  padding: 0 28px;
  border: none;
  border-radius: 9999px;
  background: var(--gmp-primary);
  color: #fff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  cursor: default;
}

.hl-bind-verify:disabled,
.hl-bind-verify.is-verifying {
  opacity: 0.85;
}

.hl-bind-verify .hl-bind-verify-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-right-color: rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  animation: hl-init-spin 0.8s linear infinite;
}

@media (max-width: 600px) {
  #hl-traffic-overlay {
    padding: 16px;
  }

  .hl-traffic-dialog {
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    padding: 32px 24px 36px;
    border-radius: 24px;
  }

  .hl-traffic-dialog:has(#hl-init-view:not([hidden])) {
    padding: 16px 20px 20px;
  }

  .hl-init-view .hl-init-brand-img {
    height: 28px;
  }

  .hl-init-view .hl-init-heading {
    font-size: 1.25rem;
    line-height: 1.5rem;
  }

  .hl-init-view .hl-init-tagline {
    margin-bottom: 10px;
    font-size: 0.8125rem;
    line-height: 1.25rem;
  }

  .hl-init-view .hl-init-session {
    margin-bottom: 8px;
  }

  .hl-init-view .hl-init-step {
    padding-bottom: 6px;
  }

  .hl-bind-text,
  .hl-bind-device-line {
    white-space: normal;
  }
}

body.hl-traffic-open {
  overflow: hidden;
}

@keyframes hl-traffic-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes hl-traffic-dialog-in {
  0% {
    opacity: 0;
    transform: scale(0.78) translateY(52px);
  }

  55% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes hl-init-spin {
  to {
    transform: rotate(360deg);
  }
}
