.xpp-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.xpp-overlay[hidden] { display: none; }
.xpp-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 2, 27, .86);
  backdrop-filter: blur(14px);
}

.xpp-phone {
  width: 390px;
  height: min(844px, calc(100dvh - 36px));
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 30px;
  color: #f7f9ff;
  background: #080914;
  box-shadow: 0 34px 90px rgba(0,0,0,.55);
  outline: none;
}

.xpp-app {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
}

.xpp-header {
  position: relative;
  z-index: 4;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(137,169,255,.2);
  background:
    radial-gradient(circle at 78% 0%, rgba(77,123,255,.26), transparent 38%),
    #080914;
}

.xpp-header-row,
.xpp-brand,
.xpp-tools,
.xpp-row {
  display: flex;
  align-items: center;
}
.xpp-header-row { justify-content: space-between; gap: 12px; }
.xpp-brand { min-width: 0; gap: 9px; }
.xpp-brand img { width: 112px; height: auto; filter: brightness(0) invert(1); }
.xpp-brand span {
  overflow: hidden;
  padding-left: 9px;
  border-left: 1px solid rgba(255,255,255,.24);
  color: #cbd5f1;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.xpp-tools { gap: 7px; }

.xpp-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(137,169,255,.28);
  border-radius: 8px;
  color: #f7f9ff;
  background: rgba(255,255,255,.06);
  cursor: pointer;
}
.xpp-icon:hover { background: rgba(255,255,255,.12); }

.xpp-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 14px;
}
.xpp-stat {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(137,169,255,.2);
  border-radius: 7px;
  background: rgba(255,255,255,.045);
}
.xpp-stat span {
  display: block;
  color: #98a7ca;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}
.xpp-stat strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xpp-content {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #4d7bff transparent;
  background:
    linear-gradient(rgba(77,123,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77,123,255,.045) 1px, transparent 1px),
    #0d1020;
  background-size: 36px 36px;
}
.xpp-screen { min-height: 100%; padding: 20px 16px 24px; }
.xpp-kicker {
  color: #89a9ff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.xpp-title {
  margin: 6px 0 0;
  color: #fff;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.12;
}
.xpp-copy {
  margin: 8px 0 0;
  color: #aeb9d5;
  font-size: 13px;
  line-height: 1.5;
}
.xpp-actions { display: grid; gap: 9px; margin-top: 16px; }
.xpp-button {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid #003df5;
  border-radius: 8px;
  color: #fff;
  background: #003df5;
  box-shadow: 0 12px 26px rgba(0,61,245,.24);
  font: 700 14px/1.2 var(--xp-font-body, Arial, sans-serif);
  cursor: pointer;
}
.xpp-button:hover:not(:disabled) { background: #174ff5; }
.xpp-button.secondary {
  border-color: rgba(137,169,255,.28);
  color: #dce4fa;
  background: rgba(255,255,255,.06);
  box-shadow: none;
}
.xpp-button.danger { border-color: #d44b64; background: #a72f48; }
.xpp-button:disabled { cursor: not-allowed; opacity: .45; }

.xpp-card,
.xpp-choice,
.xpp-empty {
  border: 1px solid rgba(137,169,255,.22);
  border-radius: 8px;
  background: rgba(255,255,255,.05);
}
.xpp-card { padding: 13px; }
.xpp-grid { display: grid; gap: 9px; margin-top: 16px; }
.xpp-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.xpp-choice {
  min-height: 74px;
  padding: 12px;
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.xpp-choice:hover:not(:disabled),
.xpp-choice.selected { border-color: #89a9ff; background: rgba(77,123,255,.14); }
.xpp-choice:disabled { cursor: not-allowed; opacity: .42; }
.xpp-choice strong { display: block; font-size: 15px; }
.xpp-choice span { display: block; margin-top: 5px; color: #9faccc; font-size: 10px; line-height: 1.35; }
.xpp-empty { margin-top: 16px; padding: 20px 14px; color: #aeb9d5; text-align: center; font-size: 13px; line-height: 1.5; }

.xpp-meter { display: grid; gap: 7px; margin-top: 16px; }
.xpp-meter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid rgba(137,169,255,.18);
  border-radius: 7px;
  background: rgba(255,255,255,.04);
}
.xpp-meter-row.active { border-color: #89a9ff; background: rgba(77,123,255,.14); }
.xpp-meter-row strong { color: #fff; font-size: 13px; }
.xpp-meter-row span { color: #9faccc; font-size: 10px; }

.xpp-progress {
  height: 7px;
  overflow: hidden;
  margin-top: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,.1);
}
.xpp-progress > span { display: block; height: 100%; background: #4d7bff; }
.xpp-pill {
  display: inline-flex;
  padding: 4px 7px;
  border: 1px solid rgba(137,169,255,.26);
  border-radius: 5px;
  color: #cbd6f5;
  font-size: 9px;
  font-weight: 700;
}
.xpp-row { justify-content: space-between; gap: 10px; }

.xpp-sheet[hidden] { display: none; }
.xpp-sheet {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: rgba(0,2,27,.66);
}
.xpp-sheet-panel {
  max-height: 78%;
  overflow-y: auto;
  padding: 18px 16px 24px;
  border-top: 1px solid rgba(137,169,255,.28);
  border-radius: 16px 16px 0 0;
  background: #111526;
  box-shadow: 0 -18px 48px rgba(0,0,0,.38);
}
.xpp-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.xpp-sheet-head h2 { margin: 0; color: #fff; font-size: 20px; }
.xpp-sheet-body { margin-top: 14px; color: #b4bfd9; font-size: 12px; line-height: 1.5; }
.xpp-sheet-body h3 { margin: 14px 0 5px; color: #fff; font-size: 14px; }
.xpp-sheet-body p { margin: 0 0 9px; }
.xpp-sheet-body ul { display: grid; gap: 7px; margin: 0; padding-left: 18px; }

.xpp-icon:focus-visible,
.xpp-button:focus-visible,
.xpp-choice:focus-visible,
.xpp-phone:focus-visible {
  outline: 3px solid #89a9ff;
  outline-offset: 2px;
}

body.xpp-open { overflow: hidden; }
body.xpp-open .modal,
body.xpp-open .popup-wrap { z-index: 1300; }

@media (max-width: 640px) {
  .xpp-overlay { padding: 0; }
  .xpp-phone {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    border: 0;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .xpp-overlay *, .xpp-overlay *::before, .xpp-overlay *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}
