.thqr-manager {
  --thqr-bg: #faf9f7;
  --thqr-panel: #ffffff;
  --thqr-panel-edge: #ebe7e2;
  --thqr-panel-edge-soft: #f3f0eb;
  --thqr-accent: #6552ff;
  --thqr-accent-soft: rgba(101, 82, 255, 0.16);
  --thqr-surface: #f6f4f2;
  --thqr-surface-strong: #ffffff;
  --thqr-stroke: #ebe6e0;
  --thqr-stroke-soft: #f0ebe6;
  --thqr-qr-frame-border: #ece7e2;
  --thqr-text: #252321;
  --thqr-text-muted: #78716a;
  --thqr-icon: #98928d;
  --thqr-shadow: 0 16px 40px rgba(34, 28, 23, 0.08), 0 4px 10px rgba(34, 28, 23, 0.04);
  --thqr-radius-xl: 29px;
  --thqr-radius-lg: 21px;
  --thqr-radius-md: 18px;
  --thqr-ease: 220ms cubic-bezier(0.22, 1, 0.36, 1);
  color: var(--thqr-text);
}

.thqr-manager,
.thqr-manager * {
  box-sizing: border-box;
}

.thqr-manager__stage {
  width: min(100%, 640px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 18px;
  margin: 0 auto;
}

.thqr-manager__trigger {
  appearance: none;
  border: 1px solid var(--thqr-stroke);
  background: rgba(255, 255, 255, 0.88);
  color: var(--thqr-text);
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(34, 28, 23, 0.06);
  padding: 16px 20px;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition:
    transform var(--thqr-ease),
    box-shadow var(--thqr-ease),
    border-color var(--thqr-ease);
}

.thqr-manager__trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(34, 28, 23, 0.08);
}

.thqr-manager__trigger svg {
  width: 22px;
  height: 22px;
  color: #7d7771;
  transition: transform var(--thqr-ease);
}

.thqr-manager__trigger[data-open="true"] svg {
  transform: rotate(180deg);
}

.thqr-manager__panel-shell {
  width: 100%;
  display: flex;
  justify-content: center;
}

.thqr-manager__panel-shell[hidden] {
  display: none;
}

.thqr-manager__panel {
  width: 100%;
  max-width: 612px;
  background: var(--thqr-panel);
  border: 1px solid var(--thqr-panel-edge);
  border-radius: var(--thqr-radius-xl);
  padding: 8px;
  box-shadow: var(--thqr-shadow);
}

.thqr-manager__panel-inner {
  position: relative;
  border: 1px solid var(--thqr-panel-edge-soft);
  border-radius: calc(var(--thqr-radius-xl) - 3px);
  padding: 42px 38px 36px;
  background:
    radial-gradient(circle at top center, rgba(255, 255, 255, 0.95), rgba(250, 249, 247, 0.7) 55%, var(--thqr-bg) 100%),
    linear-gradient(180deg, #ffffff 0%, #fffeff 100%);
}

.thqr-manager__back-button {
  position: absolute;
  top: 34px;
  left: 28px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--thqr-icon);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.thqr-manager__panel-header {
  text-align: center;
  padding: 0 24px;
}

.thqr-manager__panel-header h3 {
  margin: 0;
  color: inherit;
  font-size: 30px;
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.thqr-manager__panel-description {
  margin: 12px auto 0;
  max-width: 430px;
  font-size: 16px;
  line-height: 1.45;
  color: var(--thqr-text-muted);
  letter-spacing: -0.01em;
}

.thqr-manager__panel-description > :first-child {
  margin-top: 0;
}

.thqr-manager__panel-description > :last-child {
  margin-bottom: 0;
}

.thqr-manager__qr-frame {
  margin-top: 30px;
  min-height: 252px;
  border: 2px dashed var(--thqr-qr-frame-border);
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffffff 0%, #fefdfd 100%);
}

.thqr-manager__qr-tile {
  width: 177px;
  height: 177px;
  border: 4px solid var(--thqr-accent);
  border-radius: 16px;
  background: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px var(--thqr-accent-soft);
}

.thqr-manager__qr-tile svg {
  width: 136px;
  height: 136px;
  display: block;
  shape-rendering: crispEdges;
}

.thqr-manager__qr-graphic {
  width: 136px;
  height: 136px;
  display: grid;
  place-items: center;
}

.thqr-manager__qr-graphic svg {
  width: 100%;
  height: 100%;
  display: block;
}

.thqr-manager__placeholder {
  display: block;
  max-width: 112px;
  color: var(--thqr-text-muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.thqr-manager__detail-panel {
  margin-top: 18px;
  border: 1px solid var(--thqr-stroke-soft);
  border-radius: 16px;
  background: var(--thqr-surface);
  padding: 16px 18px;
  color: #4e4843;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

.thqr-manager__detail-panel > :first-child {
  margin-top: 0;
}

.thqr-manager__detail-panel > :last-child {
  margin-bottom: 0;
}

.thqr-manager__destination-link {
  margin-top: 18px;
  border: 1px solid var(--thqr-accent);
  border-radius: 16px;
  background: var(--thqr-accent);
  min-height: 62px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(34, 28, 23, 0.06);
  transition:
    transform var(--thqr-ease),
    box-shadow var(--thqr-ease),
    opacity var(--thqr-ease);
}

.thqr-manager__destination-link:hover,
.thqr-manager__destination-link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(34, 28, 23, 0.08);
  outline: none;
}

.thqr-manager__destination-link-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.thqr-manager__destination-link-title {
  display: block;
  color: #ffffff;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.thqr-manager__destination-link-url {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thqr-manager__destination-link-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: #ffffff;
}

.thqr-manager__profile-link {
  margin-top: 18px;
  border-radius: 16px;
  border: 1px solid var(--thqr-stroke-soft);
  background: var(--thqr-surface);
  min-height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.thqr-manager__profile-value {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.thqr-manager__profile-value span {
  font-size: 16px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thqr-manager__icon {
  width: 24px;
  height: 24px;
  color: var(--thqr-icon);
  flex: 0 0 auto;
}

.thqr-manager__icon-button {
  appearance: none;
  border: 0;
  background: transparent;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--thqr-icon);
  padding: 0;
  border-radius: 12px;
  cursor: pointer;
  transition:
    transform var(--thqr-ease),
    color var(--thqr-ease),
    opacity var(--thqr-ease);
}

.thqr-manager__icon-button:hover:not(:disabled) {
  transform: translateY(-1px);
  color: #6f6964;
}

.thqr-manager__icon-button:focus-visible {
  outline: 2px solid rgba(101, 82, 255, 0.22);
  outline-offset: 2px;
}

.thqr-manager__icon-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.thqr-manager__downloads {
  margin-top: 20px;
  display: grid;
  gap: 18px;
}

.thqr-manager__download-card {
  min-height: 80px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--thqr-stroke);
  background: var(--thqr-surface-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 5px 18px rgba(34, 28, 23, 0.03);
  transition:
    opacity var(--thqr-ease),
    transform var(--thqr-ease),
    box-shadow var(--thqr-ease),
    border-color var(--thqr-ease);
}

.thqr-manager__download-card.is-clickable {
  cursor: pointer;
}

.thqr-manager__download-card.is-clickable:hover,
.thqr-manager__download-card.is-clickable:focus-visible {
  transform: translateY(-1px);
  border-color: #ded7cf;
  box-shadow: 0 8px 22px rgba(34, 28, 23, 0.06);
  outline: none;
}

.thqr-manager__download-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.thqr-manager__file-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.thqr-manager__download-copy {
  min-width: 0;
}

.thqr-manager__download-copy strong {
  display: block;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.thqr-manager__download-copy span {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  color: var(--thqr-text-muted);
  letter-spacing: -0.01em;
}

.thqr-manager__download-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.thqr-manager__status {
  margin-top: 16px;
  min-height: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--thqr-text-muted);
}

.thqr-manager--qr-error .thqr-manager__qr-tile {
  border-style: dashed;
}

@media (max-width: 640px) {
  .thqr-manager__stage {
    gap: 14px;
  }

  .thqr-manager__trigger {
    font-size: 17px;
    padding: 14px 18px;
  }

  .thqr-manager__panel-inner {
    padding: 38px 18px 24px;
  }

  .thqr-manager__back-button {
    top: 28px;
    left: 18px;
  }

  .thqr-manager__panel-header {
    padding: 0 30px;
  }

  .thqr-manager__panel-header h3 {
    font-size: 24px;
  }

  .thqr-manager__panel-description {
    font-size: 15px;
  }

  .thqr-manager__qr-frame {
    min-height: 214px;
  }

  .thqr-manager__qr-tile {
    width: 152px;
    height: 152px;
  }

  .thqr-manager__qr-tile svg {
    width: 116px;
    height: 116px;
  }

  .thqr-manager__qr-graphic {
    width: 116px;
    height: 116px;
  }

  .thqr-manager__detail-panel,
  .thqr-manager__destination-link {
    padding: 14px 14px;
  }

  .thqr-manager__download-card {
    padding: 14px 14px;
  }

  .thqr-manager__download-copy strong {
    font-size: 17px;
  }

  .thqr-manager__download-copy span {
    font-size: 14px;
  }
}
