:root {
  --bg-0: #12100e;
  --bg-1: #1c1814;
  --ink: #f4efe6;
  --muted: #a89a88;
  --line: rgba(244, 239, 230, 0.12);
  --accent: #d4783a;
  --accent-soft: rgba(212, 120, 58, 0.18);
  --ok: #7cb87a;
  --danger: #e07060;
  --font-display: "Syne", sans-serif;
  --font-body: "Manrope", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg-0);
  line-height: 1.5;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 55% at 15% 10%, rgba(212, 120, 58, 0.16), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 80%, rgba(70, 90, 110, 0.22), transparent 50%),
    linear-gradient(165deg, #181410 0%, #0e0c0a 55%, #151a1f 100%);
  pointer-events: none;
}

.layout {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 4rem) 0 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: 1.5rem;
  align-items: start;
}

.shell {
  min-width: 0;
}

.brand {
  margin-bottom: 2rem;
  max-width: 36rem;
}

.brand__mark {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.brand__title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand__lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 32rem;
}

.dropzone {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%),
    var(--bg-1);
  min-height: min(36vh, 280px);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.25s ease, transform 0.35s ease, background 0.25s ease;
  outline: none;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: rgba(212, 120, 58, 0.55);
  transform: translateY(-2px);
}

.dropzone.is-drag {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), var(--bg-1));
}

.dropzone.is-busy {
  pointer-events: none;
  opacity: 0.72;
}

.dropzone__inner {
  text-align: center;
  padding: 2rem 1.5rem;
}

.dropzone__glyph {
  display: block;
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1.25rem;
  border: 2px solid var(--accent);
  border-radius: 50%;
  position: relative;
}

.dropzone__glyph::after {
  content: "";
  position: absolute;
  inset: 28% 42% 22% 42%;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 55%, 130% 55%, 50% 100%, -30% 55%, 0 55%);
}

.dropzone__title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
}

.dropzone__hint {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.btn {
  appearance: none;
  border: 0;
  background: var(--accent);
  color: #1a1008;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 1.4rem;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(212, 120, 58, 0.55);
}

.btn--stop {
  background: var(--danger);
  color: #1a0c0a;
}

.live {
  margin-top: 1rem;
  border: 1px solid rgba(224, 112, 96, 0.45);
  background: rgba(224, 112, 96, 0.1);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.live__pulse {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.1s ease infinite;
}

.live__label {
  margin: 0;
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.85);
  }
}

.status {
  margin-top: 1.75rem;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--line);
}

.status__file {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.pipeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.pipeline li {
  position: relative;
  padding: 0.65rem 0.5rem;
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.pipeline li.is-active {
  border-top-color: var(--accent);
  color: var(--ink);
}

.pipeline li.is-done {
  border-top-color: var(--ok);
  color: var(--ok);
}

.pipeline li.is-error {
  border-top-color: var(--danger);
  color: var(--danger);
}

.status__msg {
  margin: 1rem 0 0;
  color: var(--muted);
  min-height: 1.4em;
}

.status__msg.is-error {
  color: var(--danger);
}

.results {
  margin-top: 2rem;
}

.panel {
  border: 1px solid var(--line);
  background: rgba(28, 24, 20, 0.72);
  padding: 1.1rem 1.15rem 1.25rem;
  animation: rise 0.55s ease both;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.panel__head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.panel__body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink);
  max-height: 420px;
  overflow: auto;
}

.checklist {
  position: sticky;
  top: 1.25rem;
  border: 1px solid rgba(212, 120, 58, 0.45);
  background: rgba(28, 24, 20, 0.95);
  box-shadow: 0 0 0 1px rgba(212, 120, 58, 0.12);
  padding: 1.1rem 1rem 1.15rem;
  max-height: calc(100vh - 2.5rem);
  overflow: auto;
  z-index: 2;
}

.checklist__head {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.checklist__head h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.checklist__meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.checklist__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.checklist__item {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid rgba(244, 239, 230, 0.06);
  color: var(--muted);
  font-size: 0.92rem;
  transition: color 0.2s ease, background 0.2s ease;
}

.checklist__item:last-child {
  border-bottom: 0;
}

.checklist__item.is-checked {
  color: var(--ink);
  background: rgba(124, 184, 122, 0.08);
}

.checklist__box {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.15rem;
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.checklist__item.is-checked .checklist__box {
  border-color: var(--ok);
  background: var(--ok);
}

.checklist__item.is-checked .checklist__box::after {
  content: "";
  width: 0.35rem;
  height: 0.6rem;
  border: solid #142014;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.foot {
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .checklist {
    position: static;
    max-height: none;
    order: -1;
  }

  .shell {
    order: 1;
  }

  .pipeline {
    grid-template-columns: 1fr 1fr;
  }
}
