:root {
  --lavender-light: #f5f3ff;
  --lavender-mid: #ddd6fe;
  --lavender-prime: #8b5cf6;
  --lavender-soft: rgba(139, 92, 246, 0.1);
  --iris: #4c1d95;
  --cloud: rgba(255, 255, 255, 0.88);
  --border-silk: rgba(255, 255, 255, 0.68);
  --text-main: #1e1b4b;
  --text-sub: #6366f1;
  --danger: #ef4444;
  --success: #10b981;
  --radius: 30px;
  --shadow: 0 20px 50px rgba(139, 92, 246, 0.15);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  color: var(--text-main);
  font-family: "Plus Jakarta Sans", "Noto Sans SC", sans-serif;
  background-color: #fdfcff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-x: hidden;
}

.mist-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, #f5f3ff 0%, #ffffff 100%);
  overflow: hidden;
}

.mist-blob {
  position: absolute;
  filter: blur(100px);
  border-radius: 50%;
  opacity: 0.5;
  animation: floatMist 20s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: #ddd6fe;
  top: -10%;
  left: -5%;
}

.blob-2 {
  width: 600px;
  height: 600px;
  background: #ede9fe;
  bottom: -10%;
  right: -5%;
  animation-delay: -5s;
}

.blob-3 {
  width: 400px;
  height: 400px;
  background: #e0e7ff;
  top: 30%;
  left: 40%;
  animation-delay: -10s;
}

@keyframes floatMist {
  from {
    transform: translate(0, 0) scale(1);
  }

  to {
    transform: translate(60px, 40px) scale(1.1);
  }
}

.lavender-card {
  width: 100%;
  max-width: 620px;
  background: var(--cloud);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--border-silk);
  border-radius: var(--radius);
  padding: 50px;
  box-shadow: var(--shadow);
  position: relative;
  animation: cardIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

header {
  text-align: center;
  margin-bottom: 40px;
}

.icon-box {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #a78bfa, #8b5cf6);
  margin: 0 auto 20px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 26px;
  font-weight: 800;
  box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
}

h1 {
  font-size: 34px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #5b21b6, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-sub);
  font-size: 15px;
  margin-top: 8px;
  font-weight: 600;
  opacity: 0.8;
}

.progress-flow {
  display: flex;
  justify-content: space-between;
  margin-bottom: 50px;
  position: relative;
}

.flow-line {
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;
  height: 4px;
  background: #eef2f7;
  border-radius: 10px;
  z-index: 0;
}

.flow-fill {
  position: absolute;
  top: 18px;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #a78bfa, #8b5cf6);
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

.step-unit {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.step-dot {
  width: 36px;
  height: 36px;
  background: white;
  border: 2px solid #eef2f7;
  border-radius: 10px;
  transition: all 0.4s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #94a3b8;
}

.step-unit.active .step-dot {
  border-color: var(--lavender-prime);
  color: var(--lavender-prime);
  background: #f5f3ff;
  transform: scale(1.05);
}

.step-unit.done .step-dot {
  background: var(--lavender-prime);
  border-color: var(--lavender-prime);
  color: white;
}

.step-name {
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
  transition: 0.4s;
}

.step-unit.active .step-name {
  color: var(--lavender-prime);
}

.pane {
  animation: fadeIn 0.5s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

.hidden {
  display: none !important;
}

.field {
  margin-bottom: 24px;
}

.token-field {
  margin-top: 24px;
}

.label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  display: block;
  padding-left: 2px;
}

.label .req {
  color: var(--danger);
  margin-left: 2px;
}

.input-aura {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 4px;
  display: flex;
  transition: all 0.3s;
}

.input-aura:focus-within {
  border-color: var(--lavender-prime);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.08);
}

input,
textarea {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 15px;
  font-weight: 600;
  outline: none;
  font-family: inherit;
  min-width: 0;
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.btn {
  cursor: pointer;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-prime {
  background: linear-gradient(135deg, #60a5fa, #8b5cf6);
  color: white;
  padding: 16px 32px;
  width: 100%;
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.2);
}

.btn-prime:hover {
  filter: brightness(1.05);
  box-shadow: 0 12px 25px rgba(139, 92, 246, 0.3);
}

.btn-prime:disabled {
  background: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
  filter: none;
}

.btn-small {
  padding: 0 16px;
  background: var(--lavender-soft);
  color: var(--lavender-prime);
  font-size: 13px;
  font-weight: 800;
  border-radius: 8px;
  margin-right: 4px;
}

.tip-box {
  background: var(--lavender-soft);
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed var(--lavender-mid);
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.6;
}

.step-tile {
  background: white;
  border: 1px solid #f1f5f9;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  transition: all 0.3s;
}

.step-tile:hover {
  transform: translateX(5px);
  border-color: var(--lavender-mid);
}

.tile-dot {
  width: 32px;
  height: 32px;
  background: var(--lavender-soft);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lavender-prime);
  font-weight: 800;
  font-size: 14px;
  flex: 0 0 auto;
}

.tile-info {
  min-width: 0;
}

.tile-info b {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}

.tile-info p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.action-btn {
  background: var(--lavender-prime);
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  margin-left: auto;
  white-space: nowrap;
}

.action-btn-soft {
  background: #a78bfa;
}

.report-card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid #f1f5f9;
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 24px;
}

.report-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed #e2e8f0;
}

.report-line:last-child,
.report-line.no-border {
  border: none;
}

.report-line label {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

.report-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--iris);
  text-align: right;
  word-break: break-all;
}

#sumStat {
  color: var(--lavender-prime);
}

.log-stream {
  background: #0f172a;
  border-radius: 16px;
  padding: 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: #94a3b8;
  height: 140px;
  overflow-y: auto;
  margin-top: 12px;
  line-height: 1.6;
  display: block;
}

.log-stream b {
  color: var(--lavender-mid);
}

.control-row {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

.toast-center {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  pointer-events: none;
}

.toast-pill {
  background: white;
  color: var(--iris);
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 15px 35px rgba(139, 92, 246, 0.15);
  border: 1px solid #ede9fe;
  animation: toastIn 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

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

@media (max-width: 640px) {
  body {
    align-items: flex-start;
    padding: 14px;
  }

  .lavender-card {
    padding: 30px 20px;
    border-radius: 20px;
  }

  h1 {
    font-size: 26px;
  }

  .progress-flow {
    margin-bottom: 36px;
  }

  .step-name {
    font-size: 12px;
  }

  .step-tile {
    align-items: flex-start;
  }

  .action-btn {
    padding: 8px 12px;
  }
}
