.pw-account-tour {
  --pw-tour-surface: var(--pw-theme-surface, #fff);
  --pw-tour-ink: var(--ink, #142238);
  --pw-tour-muted: var(--muted, #52677f);
  --pw-tour-line: var(--line, #d9e3ee);
  --pw-tour-accent: #1760a9;
  --pw-tour-spotlight: #80c5ff;
  --pw-tour-dim: #0b1d39a3;
  --pw-tour-top: max(14px, env(safe-area-inset-top, 0px));
  --pw-tour-bottom: max(14px, env(safe-area-inset-bottom, 0px));
  --pw-tour-left: max(12px, env(safe-area-inset-left, 0px));
  --pw-tour-right: max(12px, env(safe-area-inset-right, 0px));
  position: fixed;
  inset: 0;
  z-index: 301;
  isolation: isolate;
  overflow: hidden;
  color: var(--pw-tour-ink);
}

dialog.pw-account-tour {
  box-sizing: border-box;
  inline-size: 100%;
  block-size: 100%;
  max-inline-size: none;
  max-block-size: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

dialog.pw-account-tour::backdrop { background: transparent; }

.pw-account-tour:not(:has(.pw-tour-spotlight:not([hidden]))) {
  background: var(--pw-tour-dim);
}

.pw-tour-spotlight {
  position: absolute;
  box-sizing: border-box;
  pointer-events: none;
  border: 2px solid var(--pw-tour-spotlight);
  border-radius: 10px;
  box-shadow: 0 0 0 100vmax var(--pw-tour-dim), inset 0 0 0 1px #173d6766;
}

.pw-tour-pointer {
  --pw-tour-pointer-x: 4px;
  --pw-tour-pointer-y: 3px;
  position: absolute;
  z-index: 1;
  inset: 0 auto auto 0;
  inline-size: 32px;
  block-size: 36px;
  pointer-events: none;
}

.pw-tour-pointer-flipped { --pw-tour-pointer-x: 28px; --pw-tour-pointer-scale-x: -1; }
.pw-tour-pointer-upward { --pw-tour-pointer-y: 33px; --pw-tour-pointer-scale-y: -1; }

.pw-tour-pointer svg {
  display: block;
  position: relative;
  inline-size: 100%;
  block-size: 100%;
  fill: #fff;
  stroke: #11365c;
  stroke-width: 2.25;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px #04162a8a);
  transform: scale(var(--pw-tour-pointer-scale-x, 1), var(--pw-tour-pointer-scale-y, 1));
}

.pw-tour-pointer-pulse {
  position: absolute;
  inset: calc(var(--pw-tour-pointer-y) - 12px) auto auto calc(var(--pw-tour-pointer-x) - 12px);
  box-sizing: border-box;
  inline-size: 24px;
  block-size: 24px;
  border: 2px solid #1899f3;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #e4f4ff, inset 0 0 0 1px #e4f4ff;
  opacity: 0;
}

.pw-tour-panel {
  position: absolute;
  z-index: 2;
  inset-inline: var(--pw-tour-left) var(--pw-tour-right);
  inset-block-end: var(--pw-tour-bottom);
  box-sizing: border-box;
  max-inline-size: 440px;
  max-block-size: calc(100% - var(--pw-tour-top) - var(--pw-tour-bottom));
  margin-inline: auto;
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(15px, 4vw, 22px);
  border: 1px solid var(--pw-tour-line);
  border-radius: 18px;
  background: var(--pw-tour-surface);
  box-shadow: 0 12px 38px #07182e5c;
}

.pw-tour-panel.pw-tour-panel-top {
  inset-block-start: var(--pw-tour-top);
  inset-block-end: auto;
}

.pw-tour-header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-block-end: 12px;
}

.pw-tour-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 35px;
  inline-size: 35px;
  block-size: 35px;
  border: 1px solid var(--pw-tour-line);
  border-radius: 10px;
  background: var(--pw-surface-subtle, #edf4fc);
  color: var(--pw-tour-accent);
  font-size: .74rem;
  font-weight: 800;
}

.pw-tour-avatar :is(img, svg) {
  display: block;
  inline-size: 23px;
  block-size: 23px;
  object-fit: contain;
}

.pw-tour-identity {
  min-inline-size: 0;
  line-height: 1.3;
}

.pw-tour-identity :is(strong, small) {
  display: block;
  overflow-wrap: anywhere;
}

.pw-tour-identity strong { font-size: .86rem; }
.pw-tour-identity small { color: var(--pw-tour-muted); font-size: .7rem; }

.pw-tour-panel [data-intro-progress] {
  margin-inline-start: auto;
  color: var(--pw-tour-muted);
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}

.pw-tour-panel h2 {
  margin: 0 0 6px;
  font-size: clamp(1.08rem, 4vw, 1.36rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.pw-tour-panel h2:focus { outline: none; }

.pw-tour-panel p {
  margin: 0;
  color: var(--pw-tour-muted);
  font-size: .91rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.pw-tour-example {
  margin-block-start: 10px;
  padding: 7px 9px 9px;
  border: 1px solid var(--pw-tour-line);
  border-radius: 10px;
  background: var(--pw-surface-subtle, #edf4fc);
  font-size: .75rem;
  line-height: 1.2;
}

.pw-tour-example-caption {
  display: block;
  margin-block-end: 6px;
  color: var(--pw-tour-muted);
  font-size: .68rem;
}

.pw-tour-example-drag {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
  align-items: stretch;
}

.pw-tour-example-sources,
.pw-tour-example-booking {
  display: grid;
  grid-auto-rows: min-content;
  justify-items: start;
  gap: 3px;
  min-inline-size: 0;
  padding: 5px 6px;
  border: 1px solid var(--pw-tour-line);
  border-radius: 7px;
  background: var(--pw-tour-surface);
}

.pw-tour-example-booking { border-inline-start: 3px solid var(--pw-tour-accent); }
.pw-tour-example-sources span,
.pw-tour-example-booking span {
  color: var(--pw-tour-muted);
  font-size: .68rem;
  overflow-wrap: anywhere;
}

.pw-tour-example-arrow {
  align-self: center;
  text-align: center;
  color: var(--pw-tour-accent);
  font-size: .95rem;
}

.pw-tour-example-chip,
.pw-tour-example-selection strong {
  box-sizing: border-box;
  max-inline-size: 100%;
  overflow: hidden;
  padding: 3px 5px;
  border: 1px solid var(--pw-tour-line);
  border-radius: 5px;
  background: var(--pw-surface-subtle, #edf4fc);
  color: var(--pw-tour-accent);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pw-tour-example-flying { display: none; }

.pw-tour-example-editor {
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--pw-tour-line);
  border-radius: 7px;
  background: var(--pw-tour-surface);
}

.pw-tour-example-selection {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  padding-inline: 4px;
  overflow-wrap: anywhere;
}

.pw-tour-example-selection strong::before { content: '✓ '; }

.pw-tour-example-save {
  justify-self: end;
  padding: 4px 6px;
  border-radius: 5px;
  background: #1760a9;
  color: #fff;
}

@media (prefers-reduced-motion: no-preference) {
  .pw-tour-example-flying {
    position: absolute;
    z-index: 1;
    inset-block-start: 19px;
    inset-inline-start: 24%;
    display: block;
    max-inline-size: 42%;
    box-shadow: 0 2px 6px #07182e38;
    transform: translateX(-50%);
    animation: pw-tour-example-drag 1.1s .15s ease-in-out both;
  }

  .pw-tour-example-flying.pw-tour-example-second {
    inset-block-start: 50px;
    animation-delay: 1.35s;
  }

  .pw-tour-example-received { animation: pw-tour-example-pick .25s 1.15s ease-out both; }
  .pw-tour-example-received.pw-tour-example-second { animation-delay: 2.35s; }
  .pw-tour-example-selection strong { animation: pw-tour-example-pick .35s .25s ease-out both; }
  .pw-tour-example-selection:nth-child(3) strong { animation-delay: .54s; }
  .pw-tour-example-selection:nth-child(4) strong { animation-delay: .83s; }
  .pw-tour-example-save { animation: pw-tour-example-save .55s 1.16s ease-out; }

  @keyframes pw-tour-example-drag {
    0% { opacity: 0; }
    19% { opacity: 1; inset-inline-start: 24%; }
    84% { opacity: 1; inset-inline-start: 76%; }
    100% { opacity: 0; inset-inline-start: 76%; }
  }

  @keyframes pw-tour-example-pick {
    from { opacity: 0; transform: scale(.93); }
    to { opacity: 1; transform: scale(1); }
  }

  @keyframes pw-tour-example-save {
    40% { transform: scale(1.06); }
  }
}

.pw-tour-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-block-start: 14px;
}

.pw-tour-actions>button {
  min-block-size: 44px;
  block-size: auto;
  padding: 7px 12px;
  font-size: .78rem;
  line-height: 1.3;
}

.pw-tour-actions>[data-intro-skip] { margin-inline-end: auto; }
.pw-tour-actions>[data-intro-next] { margin-inline-start: auto; }
.pw-tour-actions>[hidden] { display: none; }

html[data-pw-theme="dark"] .pw-account-tour {
  --pw-tour-accent: #9dcfff;
  --pw-tour-spotlight: #a0d3ff;
  --pw-tour-dim: #050810ab;
}

@media (min-width: 701px) {
  .pw-account-tour {
    --pw-tour-top: max(22px, env(safe-area-inset-top, 0px));
    --pw-tour-bottom: max(22px, env(safe-area-inset-bottom, 0px));
    --pw-tour-right: max(22px, env(safe-area-inset-right, 0px));
  }
  .pw-tour-panel { inset-inline-start: auto; inline-size: min(440px, calc(100% - 44px)); }
}

@media (max-width: 350px), (max-height: 440px) {
  .pw-tour-panel { padding: 12px; }
  .pw-tour-header { margin-block-end: 8px; }
  .pw-tour-panel p { line-height: 1.4; }
  .pw-tour-actions { margin-block-start: 10px; }
  .pw-tour-actions>button { padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .pw-tour-pointer-pulse { opacity: .9; }
}

.pw-training-introduction {
  inline-size: min(96vw, 1700px);
  block-size: min(95dvh, 1050px);
  max-inline-size: none;
  max-block-size: none;
  margin: auto;
  padding: 0;
  border: 1px solid var(--line, #cdd9e6);
  border-radius: 12px;
  color: var(--ink, #142b44);
  background: var(--card, #fff);
  overflow: hidden;
}

.pw-training-introduction[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.pw-training-introduction::backdrop { background: #112c50aa; }

.pw-training-introduction > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .35rem .75rem;
  border-block-end: 1px solid var(--line, #cdd9e6);
}

.pw-training-introduction > header > h2 { margin: 0; font-size: 1rem; }
.pw-training-introduction > header > button { min-block-size: 36px; }
.pw-training-introduction > iframe { inline-size: 100%; block-size: 100%; border: 0; background: #fff; }

@media (max-width: 700px), (max-height: 540px) {
  .pw-training-introduction { inline-size: 100vw; block-size: 100dvh; border: 0; border-radius: 0; }
}
