.tool-flow-upload-tray-hidden {
  display: none !important;
}

.tool-dropzone .tool-dropzone-panel,
[id$="-dropzone"] > [id$="-dropzone-panel"] {
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.tool-dropzone[data-dragging="true"] .tool-dropzone-panel,
[id$="-dropzone"].is-dragging > [id$="-dropzone-panel"] {
  border-color: #000;
  background:
    radial-gradient(circle at top, rgba(255, 214, 10, 0.18), transparent 55%),
    linear-gradient(180deg, #fffef7 0%, #fff8d8 100%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px) scale(1.01);
}

.tool-dropzone .tool-dropzone-badge,
[id$="-dropzone"] > [id$="-dropzone-panel"] > div:first-child {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.tool-dropzone[data-dragging="true"] .tool-dropzone-badge,
[id$="-dropzone"].is-dragging > [id$="-dropzone-panel"] > div:first-child {
  background-color: #000;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  transform: scale(1.08);
}

.tool-dropzone[data-dragging="true"] [data-dropzone-icon],
[id$="-dropzone"].is-dragging > [id$="-dropzone-panel"] > div:first-child .material-symbols-outlined {
  color: #fff7bf;
}

.tool-flow-file-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
  margin-top: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #fff;
  padding: 0.875rem 3.25rem 0.875rem 0.875rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  box-sizing: border-box;
}

.tool-flow-file-row.hidden {
  display: none !important;
}

.tool-flow-existing-file-row {
  margin-top: 0;
  padding: 0.875rem 3.25rem 0.875rem 0.875rem !important;
}

.tool-flow-file-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background: #fff7bf;
  color: #111827;
}

.tool-flow-file-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.tool-flow-file-label {
  margin: 0 0 0.125rem;
  color: #6b7280;
  font-size: 0.6875rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.tool-flow-file-name {
  margin: 0;
  overflow: hidden;
  color: #111827;
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-flow-file-meta {
  margin: 0.125rem 0 0;
  color: #6b7280;
  font-size: 0.75rem;
  line-height: 1.3;
}

.tool-flow-file-remove {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  transform: translateY(-50%);
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #4b5563;
  cursor: pointer;
  font-size: 1.125rem;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.tool-flow-file-remove:hover,
.tool-flow-file-remove:focus-visible {
  border-color: #111827;
  background: #111827;
  color: #fff;
  outline: none;
}

.tool-flow-focus {
  width: 100%;
  min-height: min(68vh, 46rem);
  display: grid;
  align-content: center;
  justify-items: center;
  padding: clamp(1rem, 4vw, 3.5rem) 0;
  box-sizing: border-box;
}

.tool-flow-focus.hidden {
  display: none !important;
}

.tool-flow-focus-card {
  position: relative;
  width: min(100%, 44rem);
  padding: clamp(1rem, 4vw, 2rem) clamp(0.25rem, 2vw, 1rem);
  text-align: center;
  box-sizing: border-box;
}

.tool-flow-processing-ad,
.tool-flow-result-ad {
  width: 100%;
}

.tool-flow-processing-ad[hidden],
.tool-flow-result-ad[hidden] {
  display: none !important;
}

.tool-flow-focus-close {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #374151;
  cursor: pointer;
  font-size: 1.2rem;
}

.tool-flow-focus-close:hover,
.tool-flow-focus-close:focus-visible {
  border-color: #111827;
  color: #111827;
  outline: none;
}

.tool-flow-focus-icon {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  border-radius: 999px;
  background: #fff7bf;
  color: #111827;
}

.tool-flow-focus-icon .material-symbols-outlined {
  font-size: 2rem;
}

.tool-flow-focus[data-state="processing"] .tool-flow-focus-icon .material-symbols-outlined,
.tool-flow-focus[data-state="processing-indeterminate"] .tool-flow-focus-icon .material-symbols-outlined,
.tool-flow-focus[data-state="preview-indeterminate"] .tool-flow-focus-icon .material-symbols-outlined {
  animation: tool-flow-spin 1.1s linear infinite;
}

.tool-flow-focus.is-success .tool-flow-focus-icon {
  background: #0f766e;
  color: #fff;
}

.tool-flow-focus.is-failure .tool-flow-focus-icon {
  background: #b91c1c;
  color: #fff;
}

.tool-flow-focus.is-failure .tool-flow-meter,
.tool-flow-focus.is-failure .tool-flow-focus-percent,
.tool-flow-focus.is-failure .tool-flow-focus-stats {
  display: none;
}

.tool-flow-focus-kicker {
  margin: 0 0 0.4rem;
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.tool-flow-focus-title {
  margin: 0;
  color: #111827;
  font-family: inherit;
  font-size: clamp(1.75rem, 4vw, 2.55rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
}

.tool-flow-focus-detail {
  max-width: 34rem;
  margin: 0.8rem auto 0;
  color: #4b5563;
  font-size: 0.95rem;
  line-height: 1.55;
}

.tool-flow-meter {
  position: relative;
  width: min(100%, 34rem);
  height: 0.8rem;
  margin: 1.5rem auto 0;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.tool-flow-meter-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #ffd700;
  transition: width 220ms ease;
}

.tool-flow-focus.is-indeterminate .tool-flow-meter-fill {
  width: 38%;
  animation: tool-flow-slide 1.35s ease-in-out infinite;
}

.tool-flow-focus[data-state="preview-indeterminate"] .tool-flow-meter,
.tool-flow-focus[data-state="preview-indeterminate"] .tool-flow-focus-percent,
.tool-flow-focus[data-state="preview-indeterminate"] .tool-flow-focus-stats {
  display: none;
}

.tool-flow-focus-percent {
  margin: 1rem 0 0;
  color: #111827;
  font-size: clamp(2.25rem, 11vw, 4.5rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.95;
}

.tool-flow-focus-stats {
  min-height: 1.2rem;
  margin: 0.6rem 0 0;
  color: #6b7280;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tool-flow-focus-stats.hidden {
  visibility: hidden;
}

.mascot-processing {
  display: grid;
  grid-template-columns: clamp(5.5rem, 14vw, 7.25rem) minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
  width: min(100%, 42rem);
  margin: 1.35rem auto 0;
  color: #111827;
}

.mascot-processing.hidden {
  display: none !important;
}

.mascot-processing__figure {
  display: grid;
  width: 100%;
  aspect-ratio: 2 / 3;
  margin: 0;
  place-items: end center;
}

.mascot-processing__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  user-select: none;
  -webkit-user-drag: none;
}

.mascot-tip-card {
  position: relative;
  display: block;
  width: 100%;
  min-height: 8.5rem;
  overflow: visible;
  border: 2px solid #111827;
  border-radius: 1.25rem;
  background: #fff;
  padding: 1rem 1.1rem 0.9rem;
  box-shadow: 0.4rem 0.45rem 0 #111827;
  color: #111827;
  cursor: pointer;
  font: inherit;
  text-align: left;
  touch-action: manipulation;
  transition:
    box-shadow 160ms ease,
    transform 160ms ease,
    border-color 160ms ease;
}

.mascot-tip-card::before {
  position: absolute;
  top: 2.15rem;
  left: -0.72rem;
  width: 1.15rem;
  height: 1.15rem;
  border-bottom: 2px solid #111827;
  border-left: 2px solid #111827;
  background: #fff;
  content: "";
  transform: rotate(45deg);
}

.mascot-tip-card:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0.5rem 0.55rem 0 #111827;
}

.mascot-tip-card:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 4px;
}

.mascot-tip-card:disabled {
  cursor: default;
  opacity: 1;
}

.mascot-tip-card__heading {
  display: block;
  margin: 0 0 0.55rem;
  color: #4b5563;
  font-size: 0.6875rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.mascot-tip-card__copy {
  display: block;
  min-height: 3.35rem;
  color: #111827;
  font-size: clamp(0.9rem, 2vw, 1rem);
  font-weight: 720;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.mascot-tip-card__tail {
  white-space: nowrap;
}

.mascot-tip-card__instruction {
  display: block;
  min-height: 1rem;
  margin-top: 0.6rem;
  color: #6b7280;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.35;
  opacity: 0;
  transition: opacity 180ms ease;
}

.mascot-tip-card__instruction.is-visible {
  opacity: 1;
}

.mascot-tip-vehicle {
  display: inline-block;
  width: 2.2em;
  height: 1.25em;
  margin-left: 0.12em;
  vertical-align: -0.34em;
  pointer-events: none;
  user-select: none;
}

.mascot-tip-vehicle.hidden {
  display: none;
}

.mascot-tip-vehicle svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.mascot-processing.is-guidance .mascot-tip-card {
  border-color: #6b7280;
  background: #fff;
  box-shadow: 0.35rem 0.35rem 0 #6b7280;
}

.mascot-processing.is-guidance .mascot-tip-card::before {
  border-color: #6b7280;
}

.tool-flow-focus.is-success .mascot-processing {
  grid-template-columns: clamp(4.75rem, 12vw, 6rem) minmax(0, 1fr);
  margin-top: 1.6rem;
}

.tool-flow-focus.is-success .mascot-processing__figure {
  width: 100%;
}

.tool-flow-focus.is-success .mascot-tip-card {
  min-height: 7.5rem;
}

.tool-flow-focus.is-failure .mascot-processing {
  margin-top: 1.4rem;
}

.tool-flow-processing-ad {
  max-width: 45.5rem;
  margin-inline: auto;
}

.tool-flow-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: min(100%, 24rem);
  min-height: 3.25rem;
  margin: 1.35rem auto 0;
  border-radius: 0.5rem;
  background: #ffd700;
  color: #111827;
  font-size: 0.95rem;
  font-weight: 900;
  text-decoration: none;
}

.tool-flow-download.hidden,
.tool-flow-retry.hidden,
.tool-flow-back.hidden,
.tool-flow-focus-close.hidden {
  display: none !important;
}

.tool-flow-download:hover,
.tool-flow-download:focus-visible {
  filter: brightness(0.96);
  outline: none;
}

.tool-flow-retry,
.tool-flow-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  margin: 0.75rem auto 0;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #fff;
  color: #374151;
  padding: 0 1rem;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
}

.tool-flow-retry {
  width: min(100%, 24rem);
  margin-top: 1.35rem;
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.tool-flow-retry:hover,
.tool-flow-retry:focus-visible,
.tool-flow-back:hover,
.tool-flow-back:focus-visible {
  border-color: #111827;
  color: #111827;
  outline: none;
}

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

@keyframes tool-flow-slide {
  0% {
    transform: translateX(-120%);
  }
  50% {
    transform: translateX(65%);
  }
  100% {
    transform: translateX(240%);
  }
}

@media (max-width: 640px) {
  .tool-flow-focus {
    min-height: 64vh;
    padding: 0.75rem 0;
  }

  .tool-flow-focus-close {
    top: 0;
    right: 0;
    width: 2.75rem;
    height: 2.75rem;
  }

  .tool-flow-file-row {
    align-items: flex-start;
    padding-right: 3.5rem;
  }

  .tool-flow-file-name {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .mascot-processing {
    grid-template-columns: clamp(4.5rem, 22vw, 5.5rem) minmax(0, 1fr);
    gap: 0.7rem;
    margin-top: 1rem;
  }

  .mascot-processing__figure {
    width: 100%;
  }

  .mascot-tip-card {
    min-height: 8rem;
    padding: 0.9rem 0.85rem 0.8rem;
    border-radius: 1rem;
    box-shadow: 0.3rem 0.35rem 0 #111827;
  }

  .mascot-tip-card::before {
    top: 1.85rem;
    left: -0.57rem;
    width: 0.9rem;
    height: 0.9rem;
  }

  .mascot-tip-card__copy {
    font-size: 0.9rem;
    line-height: 1.55;
  }
}

@media (max-width: 350px) {
  .tool-flow-focus-title {
    font-size: 1.55rem;
  }

  .tool-flow-focus-percent {
    font-size: 2.15rem;
  }

  .mascot-processing__figure {
    width: 100%;
  }

  .mascot-processing {
    grid-template-columns: 4rem minmax(0, 1fr);
    gap: 0.6rem;
  }

  .mascot-tip-card {
    min-height: 7.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tool-dropzone .tool-dropzone-panel,
  [id$="-dropzone"] > [id$="-dropzone-panel"],
  .tool-flow-meter-fill,
  .mascot-tip-card,
  .mascot-tip-card__instruction {
    transition-duration: 0.01ms !important;
  }

  .tool-flow-focus-icon .material-symbols-outlined,
  .tool-flow-focus.is-indeterminate .tool-flow-meter-fill {
    animation: none !important;
  }
}
