#ppfwRoot {
  position: fixed;
  inset: 0;
  z-index: 999998;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: none;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

#ppfwRoot,
#ppfwRoot *,
#ppfwRoot *::before,
#ppfwRoot *::after {
  box-sizing: border-box;
}

body.ppfw-open {
  overflow: hidden
}

body.ppfw-capturing .ppfw-tab {
  opacity: 0;
  pointer-events: none
}

.ppfw-tab {
  position: fixed;
  top: 50%;
  right: 0;
  z-index: 1000000;
  writing-mode: vertical-lr;
  transform: translateY(-50%);
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 104px;
  padding: 10px 6px;
  border-radius: 16px 0 0 16px;
  border: 1px solid rgba(212, 175, 55, .38);
  background: linear-gradient(180deg, rgba(12, 12, 12, .96), rgba(5, 5, 5, .98));
  box-shadow: 0 0 0 1px rgba(212, 175, 55, .06), 0 0 18px rgba(212, 175, 55, .10), 0 14px 36px rgba(0, 0, 0, .34);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .25s ease;
}

.ppfw-tab:hover {
  border-color: #d4af37;
  color: #d4af37
}

.ppfw-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .22);
  z-index: 999998;
  pointer-events: auto;
}

.ppfw-drawer {
  position: fixed;
  top: 50%;
  right: 18px;
  width: min(460px, calc(100vw - 36px));
  min-width: 460px;
  max-height: min(74dvh, 640px);
  transform: translate(112%, -50%);
  transition: transform .30s cubic-bezier(.2, .8, .2, 1);
  z-index: 999999;
  pointer-events: auto;
  background: linear-gradient(180deg, rgba(12, 12, 12, .98), rgba(5, 5, 5, .98));
  border: 1px solid rgba(212, 175, 55, .34);
  border-radius: 8px;
  box-shadow: 0 18px 52px rgba(0, 0, 0, .42);
  overflow: hidden;
}

.ppfw-drawer.is-open {
  transform: translate(0, -50%)
}

.ppfw-panel-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, .08) 0 1px, transparent 2px),
    radial-gradient(circle at 80% 16%, rgba(255, 255, 255, .06) 0 1px, transparent 2px),
    radial-gradient(circle at 66% 78%, rgba(255, 255, 255, .05) 0 1px, transparent 2px),
    linear-gradient(135deg, transparent 0 48%, rgba(255, 255, 255, .03) 49%, transparent 50%),
    linear-gradient(45deg, transparent 0 48%, rgba(255, 255, 255, .025) 49%, transparent 50%),
    radial-gradient(circle at 80% 30%, rgba(212, 175, 55, .06), transparent 28%),
    radial-gradient(circle at 20% 80%, rgba(212, 175, 55, .04), transparent 24%);
  opacity: .45;
}

.ppfw-panel-inner {
  position: relative;
  z-index: 2;
  max-height: min(74dvh, 640px);
  overflow: auto;
  padding: 18px 16px 18px;
  padding-top: 30px;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, .75) rgba(255, 255, 255, .06);
}

.ppfw-panel-inner::-webkit-scrollbar {
  width: 10px
}

.ppfw-panel-inner::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .05);
  border-radius: 999px
}

.ppfw-panel-inner::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(212, 175, 55, .92), rgba(166, 132, 32, .92));
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, .18);
}

.ppfw-panel-inner::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(232, 194, 75, .96), rgba(186, 148, 34, .96));
}

.ppfw-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(18, 18, 18, .88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .25s ease;
}

.ppfw-close:hover {
  border-color: #d4af37;
  color: #d4af37;
  transform: rotate(90deg)
}

.ppfw-kicker {
  margin: 0 0 8px;
  color: #d4af37;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.ppfw-title {
  margin: 0 0 8px;
  font-size: clamp(20px, 3.2vw, 28px);
  line-height: .95;
  letter-spacing: -.04em;
  font-weight: 700;
  color: #fff;
  min-width: 14ch;
  max-width: 14ch;
}

.ppfw-view--success .ppfw-title {
  min-width: 0;
  max-width: none;
  width: 100%;
}

.ppfw-subtitle {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
  line-height: 1.6;
}

.ppfw-message,
.ppfw-capture-status {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(212, 175, 55, .35);
  color: #fff;
  line-height: 1.55;
  font-size: 12px;
}

.ppfw-message.is-error,
.ppfw-capture-status.is-error {
  border-color: rgba(255, 120, 120, .35)
}

.ppfw-message.is-success,
.ppfw-capture-status.is-success {
  border-color: rgba(120, 220, 160, .35)
}

.ppfw-message.is-info,
.ppfw-capture-status.is-info {
  border-color: rgba(111, 151, 255, .35)
}

.ppfw-form {
  display: grid;
  gap: 14px
}

.ppfw-group {
  display: grid;
  gap: 8px
}

.ppfw-label {
  display: block;
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.ppfw-help {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, .54);
  font-size: 11px;
  line-height: 1.55;
}

.ppfw-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px
}

.ppfw-type-option {
  position: relative;
  display: block
}

.ppfw-type-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none
}

.ppfw-type-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 42px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .04);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .25s ease, background .25s ease, box-shadow .25s ease, color .25s ease;
}

.ppfw-type-option input:checked+span {
  border-color: rgba(212, 175, 55, .78);
  background: rgba(212, 175, 55, .12);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, .08);
  color: #f3d56d;
}

.ppfw-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ppfw-switch {
  position: relative;
  display: inline-flex;
  cursor: pointer
}

.ppfw-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none
}

.ppfw-switch-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 54px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  padding: 3px;
}

.ppfw-switch-thumb {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #7e7e7e;
  box-shadow: 0 0 10px rgba(0, 0, 0, .18);
  transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
  transform: translateX(0);
}

.ppfw-switch input:checked+.ppfw-switch-track .ppfw-switch-thumb {
  transform: translateX(24px);
  background: #d4af37;
  box-shadow: 0 0 14px rgba(212, 175, 55, .24);
}

.ppfw-contact {
  display: grid;
  gap: 10px
}

.ppfw-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px
}

.ppfw-field {
  display: flex;
  flex-direction: column
}

.ppfw-field label {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, .82);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.ppfw-form input[type=text],
.ppfw-form input[type=email],
.ppfw-form textarea {
  width: 100%;
  display: block;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .04);
  color: #fff;
  border-radius: 14px;
  min-height: 42px;
  padding: 0 13px;
  font-size: 13px;
  outline: none;
  box-shadow: none;
  transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}

.ppfw-form textarea {
  min-height: 94px;
  padding: 13px;
  resize: vertical;
}

.ppfw-form input::placeholder,
.ppfw-form textarea::placeholder {
  color: rgba(255, 255, 255, .38)
}

.ppfw-form input:focus,
.ppfw-form textarea:focus {
  border-color: rgba(212, 175, 55, .75);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, .10);
  background: rgba(255, 255, 255, .05);
}

.ppfw-tools-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start
}

.ppfw-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px
}

.ppfw-btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .05);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all .25s ease;
}

.ppfw-btn:hover {
  border-color: #d4af37;
  color: #d4af37
}

.ppfw-btn--primary {
  background: #d4af37;
  border-color: #d4af37;
  color: #000;
}

.ppfw-btn--primary:hover {
  color: #000;
  transform: translateY(-1px)
}

.ppfw-btn[disabled] {
  opacity: .55;
  cursor: not-allowed
}

.ppfw-preview-wrap {
  border-radius: 16px;
  border: 1px solid rgba(212, 175, 55, .24);
  background: rgba(255, 255, 255, .03);
  padding: 10px;
}

.ppfw-preview-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: #0f0f0f;
  cursor: crosshair;
}

.ppfw-actions {
  margin-top: 2px
}

.ppfw-view--success {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 100%
}

.ppfw-countdown {
  margin: 0;
  color: rgba(255, 255, 255, .72);
  line-height: 1.6;
  font-size: 12px;
}

.ppfw-invalid {
  border-color: rgba(255, 120, 120, .6) !important;
  box-shadow: 0 0 0 3px rgba(255, 120, 120, .08) !important;
}

@media (max-width:767px) {
  #ppfwRoot {
    inset: 0;
    width: 100%;
    height: 100%;
    transform: none;
  }

  .ppfw-tab {
    top: 50%;
    right: 0;
    writing-mode: vertical-lr;
    transform: translateY(-50%);
    min-height: 88px;
    padding: 8px 5px;
    font-size: 8px;
    border-radius: 14px 0 0 14px;
  }

  .ppfw-drawer {
    top: 50%;
    bottom: auto;
    right: 16px;
    left: auto;

    width: min(420px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    min-width: 0;
    max-height: min(82dvh, 620px);

    transform: translate(calc(100% + 32px), -50%);
    border-radius: 22px;
  }

  .ppfw-drawer.is-open {
    transform: translate(0, -50%);
  }

  .ppfw-panel-inner {
    width: 100%;
    max-width: 100%;
    max-height: min(82dvh, 620px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 56px 12px 16px;
  }

  .ppfw-type-grid,
  .ppfw-field-grid {
    grid-template-columns: 1fr
  }

  .ppfw-title {
    font-size: 24px;
    min-width: 0;
  }

  .ppfw-view--success .ppfw-title {
    max-width: none;
  }

  .ppfw-subtitle {
    font-size: 12px
  }

  .ppfw-toggle-row {
    align-items: center
  }
}

@media (max-width:430px) {
  .ppfw-drawer {
    right: 9px;
    width: calc(100vw - 18px);
    max-width: calc(100vw - 18px);
    max-height: min(86dvh, 650px);
    border-radius: 18px;
  }

  .ppfw-panel-inner {
    max-height: min(86dvh, 650px);
  }
}
