.toa-tour-playbook {
  margin: 0 0 20px;
  border: 1px solid var(--border-border);
  border-radius: 12px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.toa-tour-playbook[hidden] {
  display: none !important;
}

.toa-tour-playbook-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-border);
}

.toa-tour-playbook-kicker {
  color: var(--text-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.toa-tour-playbook-title {
  color: var(--text-fg);
  font-size: 18px;
  line-height: 1.3;
  font-weight: 800;
  margin: 0 0 5px;
}

.toa-tour-playbook-copy {
  color: var(--text-fg-muted);
  font-size: 13px;
  line-height: 1.5;
  max-width: 840px;
  margin: 0;
}

.toa-tour-flow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 20px 18px;
}

.toa-tour-flow-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--border-border);
  border-radius: 10px;
  background: var(--bg-surface);
  padding: 14px;
}

.toa-tour-flow-card.is-enabled {
  border-color: color-mix(in srgb, var(--bg-accent) 38%, var(--border-border));
  background: color-mix(in srgb, var(--bg-accent) 4%, var(--bg-surface));
}

.toa-tour-flow-status {
  width: max-content;
  max-width: 100%;
  border: 1px solid var(--border-border);
  border-radius: 999px;
  background: var(--bg-bg-subtle);
  color: var(--text-fg-muted);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 800;
  padding: 4px 8px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.toa-tour-flow-card h3 {
  color: var(--text-fg);
  font-size: 15px;
  line-height: 1.3;
  font-weight: 800;
  margin: 0;
}

.toa-tour-flow-card p {
  color: var(--text-fg-muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}

.toa-tour-actor-path {
  color: var(--text-fg);
  background: var(--bg-bg-subtle);
  border: 1px solid var(--border-border);
  border-radius: 8px;
  padding: 8px 9px;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 700;
}

.toa-tour-flow-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toa-tour-flow-actions span {
  color: var(--text-fg-subtle);
  font-size: 11px;
  font-weight: 700;
}

.toa-tour-btn,
.toa-tour-icon-btn {
  min-height: 36px;
  border: 1px solid var(--border-border);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.toa-tour-icon-btn {
  width: 36px;
  padding: 0;
  flex: none;
}

.toa-tour-btn:hover,
.toa-tour-icon-btn:hover {
  border-color: var(--bg-accent);
  background: var(--bg-bg-subtle);
}

.toa-tour-btn-primary {
  background: var(--bg-accent);
  border-color: var(--bg-accent);
  color: var(--text-accent-fg);
}

.toa-tour-btn-primary:hover {
  background: var(--bg-accent-hover);
  color: var(--text-accent-fg);
}

.toa-tour-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.toa-tour-floating-launcher {
  position: fixed;
  right: 18px;
  top: 50%;
  z-index: 2147483350;
  transform: translateY(-50%);
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--border-border);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  box-shadow: 0 14px 44px rgba(15, 23, 42, .2);
  cursor: pointer;
}

.toa-tour-floating-launcher span {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--bg-accent);
  color: var(--text-accent-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.toa-tour-floating-launcher strong {
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.toa-tour-shell {
  position: fixed;
  left: 116px;
  right: 24px;
  bottom: 20px;
  z-index: 2147483400;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border-border);
  border-radius: 14px;
  background: var(--bg-surface);
  box-shadow: 0 20px 70px rgba(15, 23, 42, .22);
}

.toa-tour-shell-main {
  min-width: 0;
}

.toa-tour-shell-topline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 5px;
}

.toa-tour-shell-kicker {
  color: var(--text-accent);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-right: 3px;
}

.toa-tour-badge {
  border: 1px solid color-mix(in srgb, var(--bg-accent) 24%, var(--border-border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-accent) 8%, var(--bg-surface));
  color: var(--text-accent);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 800;
  padding: 3px 7px;
}

.toa-tour-badge.is-surface {
  border-color: var(--border-border);
  background: var(--bg-bg-subtle);
  color: var(--text-fg-muted);
}

.toa-tour-shell-title {
  color: var(--text-fg);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 800;
}

.toa-tour-shell-copy {
  color: var(--text-fg-muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 3px;
}

.toa-tour-switch {
  width: max-content;
  max-width: 100%;
  margin-top: 8px;
  border: 1px solid color-mix(in srgb, var(--text-warning) 35%, var(--border-border));
  border-radius: 999px;
  background: var(--bg-warning);
  color: var(--text-warning);
  font-size: 11px;
  line-height: 1.3;
  font-weight: 800;
  padding: 5px 9px;
}

.toa-tour-shell-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toa-tour-progress {
  min-width: 86px;
  color: var(--text-fg-muted);
  font-size: 11px;
  font-weight: 750;
  text-align: right;
}

.toa-tour-highlight {
  position: relative;
  z-index: 2147483300 !important;
  outline: 3px solid var(--bg-accent) !important;
  outline-offset: 4px !important;
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--bg-accent) 14%, transparent) !important;
}

.toa-tour-pulse {
  animation: toaTourPulse 1.6s ease-in-out infinite;
}

@keyframes toaTourPulse {
  0%, 100% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--bg-accent) 14%, transparent); }
  50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--bg-accent) 8%, transparent); }
}

.toa-tour-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483450;
  background: rgba(15, 23, 42, .42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.toa-tour-preview {
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--border-border);
  border-radius: 14px;
  background: var(--bg-surface);
  box-shadow: 0 24px 90px rgba(15, 23, 42, .26);
}

.toa-tour-preview-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-border);
}

.toa-tour-preview-head h2 {
  color: var(--text-fg);
  font-size: 18px;
  line-height: 1.25;
  margin: 0 0 4px;
}

.toa-tour-preview-head p {
  color: var(--text-fg-muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.toa-tour-preview-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 20px 20px;
  margin: 0;
}

.toa-tour-preview-list li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-border);
}

.toa-tour-preview-list li:last-child {
  border-bottom: 0;
}

.toa-tour-preview-list li > span {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--bg-bg-subtle);
  border: 1px solid var(--border-border);
  color: var(--text-fg-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.toa-tour-preview-list strong {
  display: block;
  color: var(--text-fg);
  font-size: 13px;
  line-height: 1.35;
}

.toa-tour-preview-list small {
  display: block;
  color: var(--text-fg-muted);
  font-size: 11px;
  line-height: 1.4;
  margin-top: 2px;
}

@media (max-width: 1040px) {
  .toa-tour-flow-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .toa-tour-playbook-head,
  .toa-tour-shell {
    grid-template-columns: 1fr;
  }

  .toa-tour-shell {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .toa-tour-shell-actions {
    justify-content: flex-start;
  }

  .toa-tour-floating-launcher strong {
    display: none;
  }
}
