:root {
  --dgp-tour-navy: #08284a;
  --dgp-tour-blue: #1477c9;
  --dgp-tour-gold: #e4b53c;
  --dgp-tour-line: #bed2e7;
  --dgp-tour-muted: #526b84;
}

.sidebar-actions #sidebarTourButton {
  grid-column: 1 / -1;
  min-height: 42px;
  color: #fff;
  background: #1769aa;
  border-color: #4a96d8;
  box-shadow: inset 3px 0 0 #8ecbff, 0 6px 16px rgba(5, 30, 58, 0.24);
}

.sidebar-actions #sidebarTourButton:hover,
.sidebar-actions #sidebarTourButton:focus-visible {
  background: #1d7bc4;
  border-color: #8ecbff;
}

body.sidebar-collapsed .sidebar-actions #sidebarTourButton {
  grid-column: auto;
}

.dgp-tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 58;
  background: rgba(4, 19, 37, 0.55);
  backdrop-filter: blur(1px);
}

.dgp-tour-card {
  position: fixed;
  z-index: 120;
  width: min(410px, calc(100vw - 32px));
  max-height: min(680px, calc(100dvh - 32px));
  overflow: auto;
  right: 24px;
  bottom: 24px;
  color: #102b48;
  background: #fff;
  border: 1px solid var(--dgp-tour-line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(3, 20, 39, 0.34);
}

.dgp-tour-card[data-stage="welcome"],
.dgp-tour-card[data-stage="complete"] {
  top: 50%;
  right: auto;
  bottom: auto;
  left: 50%;
  transform: translate(-50%, -50%);
}

.dgp-tour-card header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 14px 16px;
  color: #fff;
  background: var(--dgp-tour-navy);
  border-bottom: 3px solid var(--dgp-tour-gold);
}

.dgp-tour-mark {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.dgp-tour-heading {
  min-width: 0;
}

.dgp-tour-heading span {
  display: block;
  margin-bottom: 2px;
  color: #b9daf7;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.3;
  text-transform: uppercase;
}

.dgp-tour-heading h2 {
  margin: 0;
  color: #fff;
  font-size: 1.12rem;
  line-height: 1.25;
}

.dgp-tour-close {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  color: #dceafb;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
}

.dgp-tour-close:hover,
.dgp-tour-close:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.dgp-tour-close svg {
  width: 18px;
  height: 18px;
}

.dgp-tour-body {
  padding: 20px;
}

.dgp-tour-body p {
  margin: 0;
  color: var(--dgp-tour-muted);
  font-size: 0.95rem;
  line-height: 1.58;
}

.dgp-tour-body strong {
  color: #163a5d;
}

.dgp-tour-modes,
.dgp-tour-sections {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.dgp-tour-modes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dgp-tour-modes > button,
.dgp-tour-sections > button {
  min-width: 0;
  min-height: 74px;
  padding: 12px;
  border: 1px solid #bfd0e2;
  border-radius: 7px;
  display: grid;
  gap: 5px;
  color: #173b5f;
  background: #f8fbfe;
  text-align: left;
}

.dgp-tour-modes > button:hover,
.dgp-tour-modes > button:focus-visible,
.dgp-tour-sections > button:hover,
.dgp-tour-sections > button:focus-visible,
.dgp-tour-sections > button.is-selected {
  border-color: #2379bd;
  background: #edf6ff;
  box-shadow: 0 0 0 3px rgba(35, 121, 189, .12);
}

.dgp-tour-modes strong,
.dgp-tour-sections strong {
  font-size: .85rem;
}

.dgp-tour-modes span,
.dgp-tour-sections small {
  color: #5b7188;
  font-size: .72rem;
  line-height: 1.35;
}

.dgp-tour-sections {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dgp-tour-sections > button {
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  min-height: 66px;
}

.dgp-tour-sections > button > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.dgp-tour-section-check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid #9db5cc;
  border-radius: 5px;
  color: #fff !important;
  background: #fff;
  font-weight: 900;
}

.dgp-tour-sections > button.is-selected .dgp-tour-section-check {
  border-color: #1769aa;
  background: #1769aa;
}

.dgp-tour-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.dgp-tour-progress-track {
  height: 7px;
  overflow: hidden;
  background: #dce8f4;
  border-radius: 4px;
}

.dgp-tour-progress-track span {
  display: block;
  width: var(--dgp-tour-progress, 0%);
  height: 100%;
  background: var(--dgp-tour-blue);
  border-radius: inherit;
  transition: width 180ms ease;
}

.dgp-tour-progress small {
  color: #315674;
  font-weight: 800;
  white-space: nowrap;
}

.dgp-tour-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 16px;
  background: #f2f7fb;
  border-top: 1px solid var(--dgp-tour-line);
}

.dgp-tour-actions button {
  min-height: 42px;
  padding: 9px 15px;
  color: #123b61;
  background: #fff;
  border: 1px solid #a9c2dc;
  border-radius: 6px;
  font-weight: 800;
}

.dgp-tour-actions button:hover,
.dgp-tour-actions button:focus-visible {
  border-color: #2b79ba;
  box-shadow: 0 0 0 3px rgba(43, 121, 186, 0.16);
}

.dgp-tour-actions .is-primary {
  color: #fff;
  background: #1769aa;
  border-color: #1769aa;
}

.dgp-tour-actions .is-primary:hover,
.dgp-tour-actions .is-primary:focus-visible {
  background: #0f5b99;
}

.dgp-tour-card :focus-visible {
  outline: 2px solid #f4c850;
  outline-offset: 2px;
}

.dgp-tour-target {
  position: relative;
  z-index: 62;
  outline: 3px solid var(--dgp-tour-gold);
  outline-offset: 3px;
  box-shadow: 0 0 0 7px rgba(228, 181, 60, 0.18);
}

body.dgp-tour-open .sidebar,
body.dgp-tour-open .sidebar-collapse {
  pointer-events: none;
}

body.dgp-tour-open .dgp-tour-card,
body.dgp-tour-open .dgp-tour-card * {
  pointer-events: auto;
}

html[data-enterprise-theme="dark"] .dgp-tour-card {
  color: #edf4fa;
  background: #122235;
  border-color: #48647e;
}

html[data-enterprise-theme="dark"] .dgp-tour-body p {
  color: #c1d1df;
}

html[data-enterprise-theme="dark"] .dgp-tour-body strong {
  color: #fff;
}

html[data-enterprise-theme="dark"] .dgp-tour-actions {
  background: #0b1724;
  border-color: #48647e;
}

html[data-enterprise-theme="dark"] .dgp-tour-actions button:not(.is-primary) {
  color: #e5f1fb;
  background: #1a2d40;
  border-color: #5e7891;
}

html[data-enterprise-theme="dark"] .dgp-tour-modes > button,
html[data-enterprise-theme="dark"] .dgp-tour-sections > button {
  color: #e9f4fd;
  background: #182c40;
  border-color: #526e87;
}

html[data-enterprise-theme="dark"] .dgp-tour-modes span,
html[data-enterprise-theme="dark"] .dgp-tour-sections small {
  color: #bfd0df;
}

@media (max-width: 900px) {
  .dgp-tour-card {
    right: 12px;
    bottom: 12px;
    width: min(420px, calc(100vw - 24px));
    max-height: min(560px, calc(100dvh - 24px));
  }

  .dgp-tour-card[data-placement="top"] {
    top: 12px;
    bottom: auto;
  }

  .dgp-tour-card[data-stage="welcome"],
  .dgp-tour-card[data-stage="complete"] {
    width: min(420px, calc(100vw - 24px));
  }
}

@media (max-width: 480px) {
  .dgp-tour-card header {
    grid-template-columns: 36px minmax(0, 1fr) 38px;
    gap: 9px;
    padding: 12px;
  }

  .dgp-tour-mark {
    width: 36px;
    height: 36px;
  }

  .dgp-tour-heading h2 {
    font-size: 1rem;
  }

  .dgp-tour-body {
    padding: 16px;
  }

  .dgp-tour-modes,
  .dgp-tour-sections {
    grid-template-columns: 1fr;
  }

  .dgp-tour-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dgp-tour-actions button {
    width: 100%;
    padding-inline: 10px;
  }

  .dgp-tour-actions .is-primary:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dgp-tour-progress-track span {
    transition: none;
  }
}
