.pwa-dialog {
  width: 448px;
  max-width: calc(100vw - 28px);
  max-height: calc(100dvh - 36px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #ffffff12;
  border-radius: 18px;
  background: #202024;
  color: #eeeeF3;
  box-shadow: 0 24px 100px #0008;
}

.pwa-dialog[open] { display: flex; flex-direction: column; }
.pwa-dialog:not([open]), .pwa-dialog [hidden] { display: none !important; }
.pwa-dialog::backdrop { background: #0009; backdrop-filter: blur(3px); }
.pwa-dialog button:focus-visible { outline: 2px solid #ff7895; outline-offset: -3px; }
.pwa-dialog button:disabled { cursor: default; opacity: .55; }

.pwa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  gap: 12px;
  min-height: 62px;
  padding: 10px 12px 10px 23px;
  border-bottom: 1px solid #ffffff08;
}

.pwa-header h2 { margin: 0; color: #eaeaf1; font-size: 17px; font-weight: 600; line-height: 28px; }
.pwa-close { display: grid; place-items: center; width: 40px; height: 40px; padding: 10px; border: 0; border-radius: 8px; background: transparent; color: #a9a9b3; }
.pwa-close:hover { background: #ffffff08; color: #fff; }
.pwa-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 22px; height: 22px; }
.pwa-icon svg { display: block; width: 100%; height: 100%; stroke-width: 1.7; }
.pwa-content { flex: 1 1 auto; min-height: 0; padding: 27px 27px 22px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.pwa-hero { text-align: center; }
.pwa-app-icon { display: block; width: 88px; height: 88px; margin: 0 auto 18px; border-radius: 22px; }
.pwa-hero h3 { margin: 0; color: #f6f6fa; font-size: 21px; font-weight: 650; line-height: 31px; }
.pwa-hero p { max-width: 330px; margin: 12px auto 0; color: #9d9da9; font-size: 13px; line-height: 1.85; }
.pwa-platform-support { margin: 12px 0 0; text-align: center; color: var(--xsd-muted, #9d9da9); font-size: 12px; line-height: 1.8; }
.pwa-platforms { margin-top: 16px; color: var(--xsd-muted, #b9b9c4); font-size: 12px; line-height: 1.8; }
.pwa-platforms summary { cursor: pointer; padding: 8px 0; color: var(--xsd-text, #eaeaf1); }
.pwa-platforms summary:focus-visible { outline: 2px solid #ff7895; outline-offset: 3px; }
.pwa-platform-guide { margin-top: 12px; padding: 12px 16px; border: 1px solid var(--xsd-line, #ffffff12); border-radius: 8px; }
.pwa-platform-guide h4 { margin: 0 0 8px; color: var(--xsd-text, #eaeaf1); font-size: 13px; }
.pwa-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 25px 0 22px; }
.pwa-feature { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; min-height: 64px; color: #b9b9c4; font-size: 11px; line-height: 18px; text-align: center; }
.pwa-feature .pwa-icon { width: 22px; height: 22px; color: #e1e1e9; }
.pwa-status { min-height: 20px; margin: 0 0 14px; color: #c6c6d0; font-size: 12px; line-height: 21px; text-align: center; }
.pwa-install, .pwa-done { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; padding: 10px 17px; border: 0; border-radius: 7px; font-size: 14px; font-weight: 550; line-height: 24px; }
.pwa-install { margin-bottom: 20px; background: #ff2d55; color: #fff; }
.pwa-install:hover { background: #ff4268; }
.pwa-instructions { margin: 0; padding: 18px 17px; border-radius: 10px; background: #ffffff05; }
.pwa-instructions h4 { margin: 0 0 11px; color: #d7d7e1; font-size: 13px; font-weight: 550; line-height: 22px; }
.pwa-steps { margin: 0; padding-left: 19px; color: #9999a6; font-size: 12px; line-height: 1.9; }
.pwa-steps li { padding-left: 2px; margin: 7px 0; }
.pwa-steps li::marker { color: #d1d1dd; font-size: 12px; }
.pwa-layout-note { margin: 17px 0; color: #71717f; font-size: 11px; line-height: 1.8; text-align: center; }
.pwa-done { background: #ffffff08; color: #d0d0dc; }
.pwa-done:hover { background: #ffffff0e; color: #fff; }

html[data-ui="mobile"] .pwa-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #17171b;
  box-shadow: none;
}

html[data-ui="mobile"] .pwa-header { min-height: calc(58px + env(safe-area-inset-top, 0px)); padding: calc(7px + env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) 7px max(21px, env(safe-area-inset-left, 0px)); }
html[data-ui="mobile"] .pwa-close { width: 44px; height: 44px; padding: 10px; }
html[data-ui="mobile"] .pwa-content { padding: 34px max(24px, env(safe-area-inset-right, 0px)) calc(25px + env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px)); }
html[data-ui="mobile"] .pwa-app-icon { width: 92px; height: 92px; margin-bottom: 23px; border-radius: 23px; }
html[data-ui="mobile"] .pwa-hero h3 { font-size: 23px; line-height: 34px; }
html[data-ui="mobile"] .pwa-hero p { margin-top: 13px; font-size: 14px; line-height: 1.85; }
html[data-ui="mobile"] .pwa-features { margin-top: 29px; margin-bottom: 24px; }
html[data-ui="mobile"] .pwa-feature { min-height: 65px; font-size: 12px; }
html[data-ui="mobile"] .pwa-status { font-size: 13px; line-height: 22px; }
html[data-ui="mobile"] .pwa-instructions { padding: 18px; }
html[data-ui="mobile"] .pwa-instructions h4 { font-size: 14px; }
html[data-ui="mobile"] .pwa-steps { font-size: 13px; line-height: 1.9; }
html[data-ui="mobile"] .pwa-steps li { margin-top: 10px; margin-bottom: 10px; }
html[data-ui="mobile"] .pwa-install, html[data-ui="mobile"] .pwa-done { min-height: 46px; font-size: 15px; }
html[data-ui="mobile"] .pwa-layout-note { font-size: 12px; line-height: 1.8; }

@media (max-height: 520px) {
  html[data-ui="mobile"] .pwa-content { padding-top: 20px; }
  html[data-ui="mobile"] .pwa-app-icon { width: 66px; height: 66px; margin-bottom: 12px; border-radius: 17px; }
  html[data-ui="mobile"] .pwa-features { margin-top: 18px; margin-bottom: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .pwa-dialog button { transition: none; }
}

/* Desktop toolbar client card. Position is anchored by the application script. */
.client-popover[hidden],
.client-popover [hidden] {
  display: none !important;
}

html[data-ui="desktop"] .client-popover {
  position: fixed;
  z-index: 72;
  width: 420px;
  max-width: calc(100vw - 24px);
  max-height: var(--client-max-height, calc(100dvh - 84px));
  margin: 0;
  padding: 24px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid #ffffff0a;
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 0 0, #68becb2e, transparent 67%),
    radial-gradient(ellipse at 100% 0, #a15c9133, transparent 64%),
    linear-gradient(180deg, #2d3038, #25262e 83%);
  color: #fff;
  box-shadow: 0 14px 45px #0004;
  transform-origin: 50% 0;
  isolation: isolate;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #ffffff25 transparent;
}

html[data-ui="desktop"] .client-popover-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 194px;
}

html[data-ui="desktop"] .client-benefits {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 1 auto;
  gap: 18px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

html[data-ui="desktop"] .client-benefits li {
  margin: 0;
  padding: 0;
  color: #fafaff;
  font-size: 19px;
  font-weight: 400;
  line-height: 27px;
  letter-spacing: .1px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 11px;
}

html[data-ui="desktop"] .client-benefits li::before { content: ""; width: 5px; height: 5px; flex: 0 0 5px; border-radius: 1px; background: #aaaab0; }

html[data-ui="desktop"] .client-art {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 164px;
  width: 164px;
  height: 184px;
  margin-right: -5px;
  opacity: .75;
  filter: saturate(.75);
  pointer-events: none;
}

html[data-ui="desktop"] .client-art svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

html[data-ui="desktop"] .client-install {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 66px;
  margin: 24px 0 0;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  background: #ff2c56;
  color: #fff;
  font-size: 23px;
  font-weight: 400;
  line-height: 30px;
  text-align: center;
}

html[data-ui="desktop"] .client-install > span:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

html[data-ui="desktop"] .client-install svg {
  display: block;
  flex: 0 0 auto;
  width: 23px;
  height: 23px;
  stroke-width: 1.8;
}

html[data-ui="desktop"] .client-install:hover {
  background: #ff4168;
  color: #fff;
}

html[data-ui="desktop"] .client-install:disabled {
  cursor: default;
  opacity: .65;
}

html[data-ui="desktop"] .client-install:focus-visible {
  outline: 2px solid #ffc0cd;
  outline-offset: 3px;
}

html[data-ui="desktop"] .client-install-status {
  margin: 12px 0 0;
  padding: 0 2px;
  color: #d6d5e2;
  font-size: 12px;
  line-height: 21px;
  text-align: center;
}

html[data-ui="desktop"] .client-popover.is-entering {
  animation: client-card-enter 160ms cubic-bezier(.2, .75, .25, 1) both;
}

html[data-ui="desktop"] .client-popover.is-closing {
  pointer-events: none;
  animation: client-card-leave 160ms ease-in both;
}

html[data-ui="mobile"] .client-popover {
  display: none;
}

@keyframes client-card-enter {
  from { opacity: 0; transform: translateY(-10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes client-card-leave {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-6px) scale(.985); }
}

@media (max-width: 460px) {
  html[data-ui="desktop"] .client-popover { padding: 20px; border-radius: 21px; }
  html[data-ui="desktop"] .client-popover-main { gap: 8px; min-height: 172px; }
  html[data-ui="desktop"] .client-benefits { gap: 16px; }
  html[data-ui="desktop"] .client-benefits li { font-size: 14px; line-height: 24px; }
  html[data-ui="desktop"] .client-art { flex-basis: 134px; width: 134px; height: 160px; }
  html[data-ui="desktop"] .client-install { min-height: 50px; margin-top: 20px; padding: 10px 12px; font-size: 15px; }
}

@media (max-width: 360px) {
  html[data-ui="desktop"] .client-art { flex-basis: 110px; width: 110px; height: 145px; }
  html[data-ui="desktop"] .client-benefits li { font-size: 13px; }
  html[data-ui="desktop"] .client-install { gap: 7px; font-size: 14px; }
}

@media (max-height: 430px) {
  html[data-ui="desktop"] .client-popover { padding: 18px; }
  html[data-ui="desktop"] .client-popover-main { min-height: 156px; }
  html[data-ui="desktop"] .client-benefits { gap: 14px; }
  html[data-ui="desktop"] .client-benefits li { font-size: 14px; line-height: 24px; }
  html[data-ui="desktop"] .client-art { flex-basis: 135px; width: 135px; height: 150px; }
  html[data-ui="desktop"] .client-install { min-height: 48px; margin-top: 18px; padding: 9px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-ui="desktop"] .client-popover.is-entering,
  html[data-ui="desktop"] .client-popover.is-closing {
    animation: none !important;
  }

  html[data-ui="desktop"] .client-install { transition: none; }
}
