:root {
  --page-w: 1280px;
  --page-h: 720px;
  --title-size: 40px;
  --code-base: 18px;
  --points-base: 18px;
  --min-font: 12px;
  --font-sans: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "Consolas", monospace;
  --color-bg: #0f172a;
  --color-surface: #111827;
  --color-panel: #1f2937;
  --color-outline: #2563eb;
  --color-muted: #334155;
  --color-border: #374151;
  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-success: #22c55e;
  --color-warn: #facc15;
  --color-error: #f87171;
  --slide-bg: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
  --btn-disabled: #475569;
  --btn-primary: #2563eb;
  --btn-primary-active: #1d4ed8;
  color-scheme: dark light;
}

/* modern-normalize inspired reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html:focus-within {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

textarea {
  resize: vertical;
}

a {
  color: inherit;
}

body:focus-visible {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-outline);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
  white-space: nowrap;
  border: 0;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  padding: 1.5rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.app-title {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.stepper {
  display: flex;
  gap: 1rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.stepper-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  background: var(--color-panel);
  color: var(--color-text-muted);
  border: 1px solid transparent;
}

.stepper-item.is-active {
  color: var(--color-text);
  border-color: var(--color-outline);
}

.stepper-item.is-complete {
  color: var(--color-success);
  border-color: var(--color-success);
}

.stepper-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--color-muted);
  font-weight: 600;
}

.stepper-item.is-active .stepper-index {
  background: var(--color-outline);
}

.stepper-item.is-complete .stepper-index {
  background: var(--color-success);
  color: #0f172a;
}

.app-main {
  flex: 1;
  display: grid;
  gap: 2rem;
  padding: 2rem clamp(1.5rem, 4vw, 3rem);
}

.wizard-step {
  display: grid;
  gap: 1.5rem;
  background: var(--color-surface);
  padding: 1.5rem;
  border-radius: 1.25rem;
  border: 1px solid var(--color-border);
  box-shadow: 0 20px 35px rgba(15, 23, 42, 0.25);
  min-width: 0;
}

.step-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.step-description {
  margin: 0.5rem 0 0;
  color: var(--color-text-muted);
}

.step-form {
  display: grid;
  gap: 0.75rem;
}

textarea {
  width: 100%;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 1rem;
  color: var(--color-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea:focus-visible {
  border-color: var(--color-outline);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.form-help {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.step-actions {
  display: flex;
  gap: 0.75rem;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  background: var(--color-panel);
  color: var(--color-text);
  font-weight: 600;
  transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s ease;
}

.btn:disabled {
  cursor: not-allowed;
  background: var(--btn-disabled);
  opacity: 0.65;
}

.btn-primary {
  background: var(--btn-primary);
}

.btn-primary:not(:disabled):active,
.btn-primary:not(:disabled):hover {
  background: var(--btn-primary-active);
}

.btn-secondary {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
}

.prompt-panel,
.status-panel,
.preview-panel {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 1rem;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  min-width: 0;
}

.prompt-header,
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.prompt-title,
.status-title,
.preview-title {
  margin: 0;
  font-size: 1rem;
}

.status-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--color-text-muted);
}

.status-list li[data-severity="error"] {
  color: var(--color-error);
}

.status-list li[data-severity="warn"] {
  color: var(--color-warn);
}

.preview-area {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem;
  background: var(--slide-bg);
  border-radius: 1rem;
  border: 1px dashed var(--color-border);
  min-height: 320px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.preview-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.preview-area .slide-preview {
  width: 100%;
  max-width: var(--page-w);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.preview-area .slide-preview .slide {
  will-change: transform;
  transition: transform 0.18s ease;
  transform-origin: top center;
}

.toast {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: 0.75rem;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
  animation: toast-in 0.2s ease;
}

.toast-message {
  font-size: 0.95rem;
}

.toast-close {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

@keyframes toast-in {
  from {
    transform: translateY(15px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 960px) {
  .app-main {
    padding: 1.5rem;
  }

  .wizard-step {
    padding: 1.25rem;
  }

  .stepper {
    flex-wrap: wrap;
  }
}

@media print {
  body {
    background: #fff;
    color: #111;
  }
  .preview-area {
    display: block;
    gap: 0;
    padding: 0;
    border: none;
    background: transparent;
    min-height: 0;
  }
  .preview-area .slide {
    margin: 0 auto;
  }
  .app-header,
  .wizard-step,
  .toast {
    display: none !important;
  }
}

.toast[data-variant="success"] {
  border-color: rgba(34, 197, 94, 0.7);
}

.toast[data-variant="warn"] {
  border-color: rgba(250, 204, 21, 0.7);
}

.toast[data-variant="error"] {
  border-color: rgba(248, 113, 113, 0.8);
}
.toast[data-variant="info"] {
  border-color: rgba(148, 163, 184, 0.6);
}





