.toast-viewport {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  left: auto;
  bottom: auto;
  transform: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 0.75rem;
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  min-width: 280px;
  max-width: 360px;
  box-shadow:
    0 10px 30px rgba(15, 23, 42, 0.12),
    0 4px 12px rgba(15, 23, 42, 0.072);
  border: 1px solid rgba(148, 163, 184, 0.3);
  transform: translateX(0);
  opacity: 1;
  animation: toast-slide-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
}

.toast--exiting {
  animation: toast-fade-out 0.2s ease forwards;
  pointer-events: none;
}

.toast__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}

.toast__content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.toast__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.toast__description {
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.3;
}

.toast__close {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 0.35rem;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.toast__close:hover,
.toast__close:focus-visible {
  background-color: rgba(148, 163, 184, 0.2);
}

.toast__close-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toast__progress {
  display: inline-flex;
  width: 16px;
  height: 16px;
}

.toast__progress svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.toast__progress-track {
  fill: none;
  stroke: currentColor;
  opacity: 0.2;
  stroke-width: 2;
}

.toast__progress-indicator {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  transition: stroke-dashoffset 120ms linear;
}

.toast--success .toast__icon {
  color: #12b76a;
}

.toast--error .toast__icon {
  color: #f04438;
}

.toast--info .toast__icon {
  color: #2e90fa;
}

.toast--loading .toast__icon {
  color: #6366f1;
  animation: toast-spin 900ms linear infinite;
}

.toast--loading .toast__icon svg {
  animation: toast-spin 900ms linear infinite;
}

[data-theme='light'] .toast {
  background: #0f172a;
  color: #f8fafc;
  border-color: rgba(15, 23, 42, 0.4);
}

[data-theme='dark'] .toast {
  background: #ffffff;
  color: #0b1120;
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow:
    0 10px 30px rgba(15, 23, 42, 0.108),
    0 4px 12px rgba(15, 23, 42, 0.06);
}

[data-theme='dark'] .toast__close:hover,
[data-theme='dark'] .toast__close:focus-visible {
  background-color: rgba(15, 23, 42, 0.08);
}

@keyframes toast-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  .toast-viewport {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    align-items: stretch;
  }

  .toast {
    width: 100%;
    max-width: none;
  }
}

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateX(2rem);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-fade-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(1rem);
  }
}
.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  pointer-events: none;
  font-family: inherit;
}

.tutorial-overlay__shield {
  position: fixed;
  inset: 0;
  pointer-events: auto;
  background: transparent;
}

.tutorial-overlay__highlight {
  position: fixed;
  border-radius: 12px;
  border: 2px solid var(--accent-1);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--accent-1) 30%, transparent),
    0 0 0 9999px rgba(9, 13, 24, 0.408),
    0 18px 48px -12px rgba(15, 23, 42, 0.33);
  transition:
    top 0.18s ease,
    left 0.18s ease,
    width 0.18s ease,
    height 0.18s ease;
  pointer-events: none;
  background: color-mix(in srgb, var(--accent-1) 20%, transparent);
  isolation: isolate;
}

.tutorial-overlay__highlight::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  border: 2px solid color-mix(in srgb, var(--accent-1) 65%, transparent);
  opacity: 0;
  pointer-events: none;
  animation: tutorial-overlay__highlight-pulse 2.4s ease-in-out infinite;
}

@keyframes tutorial-overlay__highlight-pulse {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }

  35% {
    opacity: 0.7;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.05);
  }
}

.tutorial-overlay__highlight--fallback {
  border-style: dashed;
}

.tutorial-overlay__panel {
  position: fixed;
  max-width: min(360px, calc(100% - 2 * 16px));
  min-width: min(320px, calc(100% - 2 * 16px));
  background: var(--panel-bg);
  color: var(--text-1);
  border-radius: 12px;
  padding: 20px 24px 24px;
  box-shadow: 0 20px 48px -24px rgba(15, 23, 42, 0.39);
  border: 1px solid var(--border);
  pointer-events: auto;
}

.tutorial-overlay__step-count {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}

.tutorial-overlay__title {
  font-size: 1.1rem;
  margin: 0 0 8px;
}

.tutorial-overlay__description {
  margin: 0 0 12px;
  color: var(--text-2);
}

.tutorial-overlay__actions-list {
  margin: 0 0 16px 16px;
  padding: 0;
  color: var(--text-1);
  list-style: disc;
}

.tutorial-overlay__actions-list li + li {
  margin-top: 6px;
}

.tutorial-overlay__warning {
  margin: 0 0 16px;
  font-size: 0.85rem;
  color: var(--color-warning-400);
}

.tutorial-overlay__buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tutorial-overlay__button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tutorial-overlay__button--primary {
  margin-left: auto;
}

.tutorial-overlay__buttons-spacer {
  flex: 1 1 auto;
}

.tutorial-overlay__key-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-3);
}

.tutorial-overlay__key-hint kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.75rem;
  line-height: 1;
  border-radius: 4px;
  padding: 2px 6px;
  background: color-mix(in srgb, var(--border-strong) 35%, transparent);
  color: inherit;
  border: 1px solid color-mix(in srgb, var(--border-strong) 65%, transparent);
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.09);
}

@media (max-width: 640px) {
  .tutorial-overlay__panel {
    min-width: calc(100% - 2 * 16px);
    max-width: calc(100% - 2 * 16px);
    padding: 16px;
  }

  .tutorial-overlay__buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .tutorial-overlay__button--primary {
    margin-left: 0;
  }

  .tutorial-overlay__buttons-spacer {
    display: none;
  }
}
