:root {
  --bvg-ink: #17202a;
  --bvg-muted: #667085;
  --bvg-line: #e4e7ec;
  --bvg-soft: #f7f8fa;
  --bvg-primary: #0f766e;
  --bvg-primary-hover: #115e59;
  --bvg-accent: #f59e0b;
  --bvg-danger: #b42318;
}

#bvg-launch,
#bvg-dialog,
#bvg-dialog * {
  box-sizing: border-box;
  letter-spacing: 0;
}

#bvg-launch {
  align-items: center;
  background: #17202a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  bottom: 24px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.22);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: 600 14px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  position: fixed;
  right: 24px;
  z-index: 1900;
}

#bvg-launch:hover {
  background: #263340;
}

#bvg-launch:focus-visible,
#bvg-dialog button:focus-visible,
#bvg-dialog a:focus-visible {
  outline: 3px solid rgba(245, 158, 11, 0.55);
  outline-offset: 2px;
}

#bvg-dialog {
  background: #fff;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(16, 24, 40, 0.28);
  color: var(--bvg-ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: auto;
  max-height: min(780px, calc(100dvh - 48px));
  max-width: 900px;
  overflow: hidden;
  padding: 0;
  width: calc(100% - 48px);
}

#bvg-dialog::backdrop {
  background: rgba(16, 24, 40, 0.58);
  backdrop-filter: blur(2px);
}

.bvg-shell {
  display: flex;
  flex-direction: column;
  max-height: min(780px, calc(100dvh - 48px));
}

.bvg-header {
  align-items: center;
  border-bottom: 1px solid var(--bvg-line);
  display: flex;
  justify-content: space-between;
  min-height: 76px;
  padding: 14px 20px;
}

.bvg-title-wrap {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.bvg-brand-mark,
.bvg-app-icon {
  align-items: center;
  background: #e8f4f2;
  border-radius: 8px;
  color: var(--bvg-primary);
  display: inline-flex;
  flex: 0 0 auto;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.bvg-title-wrap h2,
.bvg-section h3 {
  color: var(--bvg-ink);
  font-weight: 700;
  letter-spacing: 0;
  margin: 0;
}

.bvg-title-wrap h2 {
  font-size: 18px;
  line-height: 1.4;
}

.bvg-title-wrap p,
.bvg-section-heading p,
.bvg-qr-panel p {
  color: var(--bvg-muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 2px 0 0;
}

.bvg-icon-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #475467;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  height: 40px;
  justify-content: center;
  padding: 0;
  width: 40px;
}

.bvg-icon-button:hover {
  background: var(--bvg-soft);
  color: var(--bvg-ink);
}

.bvg-body {
  overflow-y: auto;
  padding: 18px 20px 22px;
}

.bvg-platforms {
  background: var(--bvg-soft);
  border: 1px solid var(--bvg-line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 4px;
}

.bvg-platform {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #475467;
  cursor: pointer;
  display: inline-flex;
  font: 600 13px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  gap: 7px;
  justify-content: center;
  min-height: 40px;
  padding: 0 8px;
  white-space: nowrap;
}

.bvg-platform:hover {
  color: var(--bvg-ink);
}

.bvg-platform.is-active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12);
  color: var(--bvg-primary);
}

.bvg-section {
  margin-top: 22px;
}

.bvg-section-heading {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.bvg-section h3 {
  font-size: 15px;
  line-height: 1.5;
}

.bvg-guide-link,
.bvg-download,
.bvg-primary,
.bvg-secondary {
  align-items: center;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  font: 600 13px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  gap: 7px;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  text-decoration: none;
  white-space: nowrap;
}

.bvg-guide-link {
  color: var(--bvg-primary);
}

.bvg-guide-link:hover {
  color: var(--bvg-primary-hover);
}

.bvg-app-list {
  border-bottom: 1px solid var(--bvg-line);
  border-top: 1px solid var(--bvg-line);
}

.bvg-app-row {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 72px;
  padding: 10px 0;
}

.bvg-app-row + .bvg-app-row {
  border-top: 1px solid var(--bvg-line);
}

.bvg-app-meta,
.bvg-app-actions,
.bvg-tool-row {
  align-items: center;
  display: flex;
}

.bvg-app-meta {
  gap: 12px;
  min-width: 0;
}

.bvg-app-icon {
  background: #f2f4f7;
  color: #344054;
  height: 38px;
  width: 38px;
}

.bvg-app-meta strong,
.bvg-app-meta span {
  display: block;
}

.bvg-app-meta strong {
  color: var(--bvg-ink);
  font-size: 14px;
  line-height: 1.45;
}

.bvg-app-meta span {
  color: var(--bvg-muted);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 1px;
}

.bvg-app-actions {
  flex: 0 0 auto;
  gap: 8px;
}

.bvg-download,
.bvg-secondary {
  background: #fff;
  border: 1px solid #d0d5dd;
  color: #344054;
}

.bvg-download:hover,
.bvg-secondary:hover {
  background: var(--bvg-soft);
  color: var(--bvg-ink);
}

.bvg-primary {
  background: var(--bvg-primary);
  border: 1px solid var(--bvg-primary);
  color: #fff;
}

.bvg-primary:hover {
  background: var(--bvg-primary-hover);
  border-color: var(--bvg-primary-hover);
}

.bvg-tool-row {
  flex-wrap: wrap;
  gap: 8px;
}

.bvg-qr-panel {
  align-items: center;
  border-top: 1px solid var(--bvg-line);
  display: flex;
  flex-direction: column;
  margin-top: 16px;
  padding-top: 16px;
}

.bvg-qr-panel[hidden] {
  display: none;
}

.bvg-qr {
  background: #fff;
  border: 1px solid var(--bvg-line);
  border-radius: 8px;
  min-height: 226px;
  min-width: 226px;
  padding: 8px;
}

.bvg-qr img,
.bvg-qr canvas {
  display: block;
  height: 208px !important;
  width: 208px !important;
}

.bvg-status {
  background: #fff;
  border: 1px solid transparent;
  border-radius: 6px;
  bottom: 14px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.14);
  color: var(--bvg-ink);
  font-size: 13px;
  left: 50%;
  max-width: calc(100% - 40px);
  opacity: 0;
  padding: 9px 12px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 10px);
  transition: opacity 160ms ease, transform 160ms ease;
  visibility: hidden;
  z-index: 2;
}

.bvg-status.is-loading,
.bvg-status.is-success,
.bvg-status.is-error {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

.bvg-status.is-success {
  border-color: #a6f4c5;
}

.bvg-status.is-loading {
  border-color: #fedf89;
}

.bvg-status.is-error {
  border-color: #fecdca;
  color: var(--bvg-danger);
}

@media (max-width: 720px) {
  #bvg-launch {
    bottom: 16px;
    right: 16px;
  }

  #bvg-dialog {
    border-radius: 8px 8px 0 0;
    height: min(92dvh, 760px);
    margin: auto 0 0;
    max-height: 92dvh;
    width: 100%;
  }

  .bvg-shell {
    height: 100%;
    max-height: 92dvh;
  }

  .bvg-header {
    min-height: 68px;
    padding: 11px 14px;
  }

  .bvg-body {
    padding: 14px 14px 24px;
  }

  .bvg-platforms {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bvg-platform {
    min-height: 38px;
  }

  .bvg-app-row {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px 0;
  }

  .bvg-app-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .bvg-download,
  .bvg-primary {
    width: 100%;
  }

  .bvg-tool-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .bvg-secondary {
    width: 100%;
  }
}

@media (max-width: 390px) {
  #bvg-launch span {
    display: none;
  }

  #bvg-launch {
    justify-content: center;
    padding: 0;
    width: 44px;
  }

  .bvg-platform {
    font-size: 12px;
    gap: 5px;
    padding: 0 4px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .bvg-status {
    transition: none;
  }
}
