:root {
  --bg: #0f0f12;
  --panel: #15161a;
  --text: #f1f2f5;
  --muted: #b9bfca;
  /* Brand: #b02f34 */
  --primary: #b02f34;
  --primary-600: #8e262a;
  --primary-400: #d24449;
  --ring: rgba(176, 47, 52, 0.45);
}

#root {
  width: 100%;
  margin: 0;
  padding: 0;
}

.app-root {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--text);
}

.app-title {
  margin: 0;
  font-size: 1.75rem;
  letter-spacing: 0.3px;
  color: var(--primary-400);
}
.app-subtitle {
  margin: 0 0 1rem 0;
  color: var(--muted);
}

.tour-root {
  background: var(--panel);
  border: 1px solid #262a33;
  border-radius: 14px;
  padding: 16px;
}

.tour-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b0d10;
  border-radius: 10px;
  overflow: hidden;
}

.tour-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.tour-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(transparent 45%, rgba(0,0,0,0.45));
  pointer-events: none;
}

.tour-selective-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  pointer-events: none;
  transition: background-color 300ms ease;
}

.tour-highlight-window {
  position: absolute;
  background: transparent;
  pointer-events: none;
  border-radius: 10px;
  transition: all 300ms ease;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
}

.tour-hotspot {
  position: absolute;
  border: 2px dashed rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  background: rgba(176, 47, 52, 0.10);
  transition: all 180ms ease;
  z-index: 10;
}
.tour-hotspot:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 6px rgba(176, 47, 52, 0.18), 0 0 0 1px var(--primary);
}
.tour-hotspot.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 6px rgba(176, 47, 52, 0.25), 0 0 0 1px var(--primary);
  background: rgba(176, 47, 52, 0.15);
}

.tour-popover {
  position: absolute;
  transform: translateX(-2%);
  min-width: 280px;
  max-width: 420px;
  background: #111319;
  border: 1px solid #262a33;
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.tour-popover.side-left {
  transform: translateX(-102%);
}
.tour-popover.side-right {
  transform: translateX(2%);
}

.tour-popover-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.tour-step-pill {
  background: var(--primary);
  color: white;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
}
.tour-title {
  font-weight: 600;
}
.tour-desc {
  color: var(--muted);
  margin: 6px 0 10px 0;
}
.tour-body {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.tour-body.has-media-left {
  flex-direction: row;
}
.tour-body.has-media-below {
  flex-direction: column;
}
.tour-text { flex: 1; }
.tour-media {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #2a2f39;
  margin: 6px 0 10px 0;
}
.media-small-left {
  max-width: 70%;
  max-height: 160px;
  margin: 0 10px 6px 0;
}
.media-small-below {
  max-width: 100%;
  max-height: 160px;
}
.tour-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tour-editor { margin: 6px 0 10px 0; }
.tour-editor .row { display: flex; justify-content: center; gap: 8px; }
.region-pre {
  margin-top: 8px;
  font-size: 12px;
  background: #0d0f14;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #222734;
  color: #cbd5e1;
}
.btn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #2a2f39;
  background: #171a21;
  color: var(--text);
  cursor: pointer;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn.primary {
  background: var(--primary);
  border-color: var(--primary-600);
}
.btn.ghost {
  background: transparent;
}
.grow { flex: 1; }

.tour-progress {
  height: 6px;
  background: #1b1f27;
  border-radius: 999px;
  margin-top: 14px;
  overflow: hidden;
}
.tour-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-400));
}

.tour-step-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #2a2f39;
  border: 1px solid #3a4050;
}
.dot.active {
  background: var(--primary);
  border-color: var(--ring);
}

/* Start Screen Styles */
.start-screen {
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: var(--panel);
  border: 1px solid #262a33;
  border-radius: 14px;
  padding: 20px;
}

.dashboard-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b0d10;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #262a33;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.start-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.start-button {
  padding: 14px 32px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
  box-shadow: 0 4px 12px rgba(176, 47, 52, 0.3);
}

.start-button:hover {
  background: var(--primary-600);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(176, 47, 52, 0.4);
}

.start-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(176, 47, 52, 0.3);
}

/* New Onboarding Tour Styles */
.new-tour-container {
  background: var(--panel);
  border: 1px solid #262a33;
  border-radius: 14px;
  padding: 16px;
}

.new-tour-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b0d10;
  border-radius: 10px;
  overflow: hidden;
}

.new-tour-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.tour-start-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tour-start-button {
  padding: 16px 40px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
  box-shadow: 0 4px 12px rgba(176, 47, 52, 0.3);
}

.tour-start-button:hover {
  background: var(--primary-600);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(176, 47, 52, 0.4);
}

.tour-dark-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.tour-highlight-window {
  position: absolute;
  background: transparent;
  pointer-events: none;
  border-radius: 10px;
  transition: all 300ms ease;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
}

.tour-step-popup {
  position: absolute;
  background: #111319;
  border: 1px solid #262a33;
  border-radius: 12px;
  padding: 20px;
  color: var(--text);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  min-width: 300px;
  max-width: 400px;
  /* Default position - will be overridden by inline styles */
  top: 20px;
  right: 20px;
}

.tour-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.tour-step-counter {
  background: var(--primary);
  color: white;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.tour-step-title {
  margin: 0;
  font-weight: 600;
  font-size: 1.1rem;
}

.tour-step-description {
  margin: 0 0 16px 0;
  color: var(--muted);
  line-height: 1.5;
}

.tour-step-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tour-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #2a2f39;
  background: #171a21;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  transition: all 200ms ease;
}

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

.tour-btn-primary {
  background: var(--primary);
  border-color: var(--primary-600);
  color: white;
}

.tour-btn-primary:hover:not(:disabled) {
  background: var(--primary-600);
}

.tour-btn-secondary:hover:not(:disabled) {
  background: #1f2329;
}

.tour-step-dots {
  display: flex;
  gap: 6px;
}

.tour-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2a2f39;
  border: none;
  cursor: pointer;
  transition: all 200ms ease;
}

.tour-dot.active {
  background: var(--primary);
}

.tour-dot:hover {
  background: var(--primary-400);
}

/* Modal Styles */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--panel);
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
  overflow: hidden;
}

.modal-content {
  background: #0b0d10;
  border: none;
  border-radius: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideIn 0.3s ease-out;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #262a33;
  background: #0f0f12;
  flex-shrink: 0;
}

.modal-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-400);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 200ms ease;
}

.modal-close-btn:hover {
  background: #262a33;
  color: var(--text);
}

.modal-body {
  flex: 1;
  padding: 0;
  overflow: hidden;
  background: #0b0d10;
}

.modal-image-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: #0b0d10;
  border-radius: 0;
  overflow: hidden;
}

.modal-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Modal Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
