:root {
  color-scheme: dark;
  --bg: #061018;
  --bg-deep: #02060b;
  --panel-strong: rgba(14, 25, 38, 0.94);
  --ink: #f8fbf2;
  --muted: #b5c0c8;
  --brand: #c7f113;
  --brand-rgb: 199, 241, 19;
  --teal: #25d7cd;
  --teal-rgb: 37, 215, 205;
  --blue: #6b9dff;
  --blue-rgb: 107, 157, 255;
  --danger: #ff8f8f;
  --max-width: 1800px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after,
.ambient-grid {
  content: "";
  position: fixed;
  pointer-events: none;
}

body::before {
  inset: 0;
  z-index: -4;
  background:
    linear-gradient(118deg, rgba(var(--brand-rgb), 0.24) 0%, rgba(var(--brand-rgb), 0.07) 22%, transparent 44%),
    linear-gradient(292deg, rgba(var(--blue-rgb), 0.14) 0%, transparent 34%),
    linear-gradient(180deg, #07121d 0%, #0a1622 48%, var(--bg-deep) 100%);
  background-size: 132% 132%;
  animation: backgroundShift 18s ease-in-out infinite alternate;
}

body::after {
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(118deg, transparent 0 37%, rgba(255, 255, 255, 0.09) 38%, transparent 39% 100%),
    linear-gradient(297deg, transparent 0 63%, rgba(var(--brand-rgb), 0.1) 64%, transparent 65% 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent 38% 62%, rgba(255, 255, 255, 0.018));
  opacity: 0.64;
  animation: bandShift 16s ease-in-out infinite alternate;
}

.ambient-grid {
  inset: -12%;
  z-index: -2;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 96px);
  opacity: 0.5;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

svg {
  display: block;
}

.app-shell {
  display: grid;
  gap: 22px;
  width: min(var(--max-width), calc(100% - 64px));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 28px 0 30px;
}

.topbar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    linear-gradient(180deg, rgba(11, 21, 31, 0.88), rgba(6, 12, 18, 0.72));
  box-shadow: 0 22px 62px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
  animation: headerIn 640ms ease both;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  color: #ffffff;
  text-decoration: none;
}

.brand-logo {
  display: grid;
  place-items: center;
  width: 220px;
  height: 78px;
  min-width: 220px;
  overflow: hidden;
  border: 1px solid rgba(var(--brand-rgb), 0.58);
  border-radius: 8px;
  background: #000000;
  box-shadow:
    0 24px 55px rgba(0, 0, 0, 0.42),
    0 0 45px rgba(var(--brand-rgb), 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7px 12px;
  filter: brightness(1.16) saturate(1.24) drop-shadow(0 0 14px rgba(var(--brand-rgb), 0.3));
}

.logo-fallback {
  display: none;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--brand);
  font-weight: 900;
}

.brand-copy {
  display: grid;
  min-width: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.92rem;
  font-weight: 800;
}

.brand-copy strong {
  color: #ffffff;
  font-size: 1.18rem;
  line-height: 1.1;
}

.topbar-copy {
  display: grid;
  justify-items: start;
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  margin: 0 0 10px;
  padding: 0 13px;
  border: 1px solid rgba(var(--brand-rgb), 0.42);
  border-radius: 8px;
  background: rgba(var(--brand-rgb), 0.12);
  color: var(--brand);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  box-shadow: 0 0 30px rgba(var(--brand-rgb), 0.08);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 0;
  color: #ffffff;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 0.94;
  letter-spacing: 0;
  text-shadow: 0 18px 55px rgba(0, 0, 0, 0.44);
}

h2 {
  margin-bottom: 8px;
  color: #ffffff;
  font-size: 1.28rem;
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  color: #ffffff;
  font-size: 1rem;
}

.server-chip {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(16px);
}

.server-chip::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 8px rgba(var(--brand-rgb), 0.14), 0 0 28px rgba(var(--brand-rgb), 0.55);
  animation: statusPulse 1.8s ease-in-out infinite;
}

.workspace {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(360px, 0.8fr);
  gap: 22px;
  animation: contentIn 780ms ease 100ms both;
}

.workspace::before {
  content: "";
  position: absolute;
  inset: 52px -18px 18px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(var(--brand-rgb), 0.075), transparent 28% 72%, rgba(var(--blue-rgb), 0.07)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 36px 100px rgba(0, 0, 0, 0.24);
}

.upload-panel,
.summary-panel,
.report-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(var(--brand-rgb), 0.34);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), transparent 36%),
    linear-gradient(160deg, rgba(var(--brand-rgb), 0.09), transparent 48%),
    linear-gradient(180deg, var(--panel-strong), rgba(7, 14, 21, 0.95));
  box-shadow:
    0 34px 80px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.035),
    0 0 54px rgba(var(--brand-rgb), 0.08);
}

.upload-panel::before,
.summary-panel::before,
.report-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-top: 4px solid var(--brand);
  background:
    linear-gradient(90deg, rgba(var(--brand-rgb), 0.11), transparent 44%),
    linear-gradient(138deg, transparent 0 55%, rgba(255, 255, 255, 0.08) 56%, transparent 57% 100%);
  pointer-events: none;
}

.upload-panel > *,
.summary-panel > *,
.report-panel > * {
  position: relative;
  z-index: 1;
}

.upload-panel {
  padding: 24px;
}

.drop-zone {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 12px;
  min-height: 280px;
  padding: 32px;
  border: 2px dashed rgba(var(--brand-rgb), 0.48);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(var(--brand-rgb), 0.11), rgba(var(--teal-rgb), 0.06)),
    rgba(255, 255, 255, 0.035);
  text-align: center;
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.drop-zone.is-dragging {
  border-color: var(--brand);
  background-color: rgba(var(--brand-rgb), 0.1);
  box-shadow: 0 0 48px rgba(var(--brand-rgb), 0.1);
  transform: translateY(-2px);
}

.drop-zone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border: 1px solid rgba(var(--brand-rgb), 0.6);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(var(--brand-rgb), 0.2), rgba(255, 255, 255, 0.07)),
    rgba(255, 255, 255, 0.04);
  color: var(--brand);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.17),
    0 20px 38px rgba(0, 0, 0, 0.22),
    0 0 42px rgba(var(--brand-rgb), 0.12);
}

.drop-icon svg {
  width: 42px;
  height: 42px;
}

.drop-icon path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.drop-zone p {
  max-width: 540px;
  margin-bottom: 5px;
  color: var(--muted);
  font-weight: 700;
}

.controls {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(270px, auto) auto;
  gap: 14px;
  align-items: end;
  margin-top: 18px;
}

.quality-control,
.minify-options {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.quality-control {
  display: grid;
  gap: 8px;
}

.quality-control span,
.minify-options legend {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.quality-control strong {
  color: var(--brand);
  font-size: 1.34rem;
  line-height: 1;
}

.quality-control input {
  width: 100%;
  accent-color: var(--brand);
}

.minify-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.minify-options legend {
  padding: 0 5px;
}

.minify-options label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 39px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.88rem;
  font-weight: 900;
  cursor: pointer;
}

.minify-options input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.94);
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:disabled,
.button.is-disabled {
  cursor: not-allowed;
  opacity: 0.48;
  pointer-events: none;
}

.button-primary {
  border-color: rgba(var(--brand-rgb), 0.48);
  background:
    linear-gradient(135deg, rgba(var(--brand-rgb), 0.26), rgba(var(--teal-rgb), 0.12)),
    rgba(255, 255, 255, 0.08);
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.24),
    0 0 44px rgba(var(--brand-rgb), 0.12);
}

.button-secondary {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.085);
}

.progress-block {
  margin-top: 18px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.progress-label strong {
  color: var(--brand);
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--teal), var(--blue));
  box-shadow: 0 0 28px rgba(var(--brand-rgb), 0.18);
  transition: width 220ms ease;
}

.summary-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 24px;
  border-color: rgba(var(--blue-rgb), 0.34);
}

.summary-panel::before {
  border-top-color: var(--blue);
  background:
    linear-gradient(90deg, rgba(var(--blue-rgb), 0.11), transparent 44%),
    linear-gradient(138deg, transparent 0 55%, rgba(255, 255, 255, 0.08) 56%, transparent 57% 100%);
}

.metric {
  display: grid;
  gap: 8px;
  min-height: 90px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.065);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.metric span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.metric strong {
  color: #ffffff;
  font-size: 1.48rem;
  line-height: 1.1;
}

.download-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.report-panel {
  margin-top: 0;
  padding: 24px;
  border-color: rgba(var(--teal-rgb), 0.34);
  animation: contentIn 780ms ease 180ms both;
}

.report-panel::before {
  border-top-color: var(--teal);
  background:
    linear-gradient(90deg, rgba(var(--teal-rgb), 0.11), transparent 44%),
    linear-gradient(138deg, transparent 0 55%, rgba(255, 255, 255, 0.08) 56%, transparent 57% 100%);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  text-align: left;
  vertical-align: middle;
}

th {
  background: rgba(255, 255, 255, 0.075);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

td {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.93rem;
  font-weight: 650;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.empty-row td {
  color: var(--muted);
  text-align: center;
}

.warnings {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 143, 143, 0.42);
  border-radius: 8px;
  background: rgba(255, 143, 143, 0.08);
  color: var(--danger);
}

.warnings ul {
  margin: 0;
  padding-left: 20px;
}

.warnings li + li {
  margin-top: 6px;
}

@keyframes backgroundShift {
  from {
    background-position: 0% 0%;
  }

  to {
    background-position: 100% 100%;
  }
}

@keyframes bandShift {
  from {
    transform: translate3d(-18px, -8px, 0);
  }

  to {
    transform: translate3d(18px, 8px, 0);
  }
}

@keyframes headerIn {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }

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

@keyframes contentIn {
  from {
    opacity: 0;
    transform: translateY(22px);
  }

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

@keyframes statusPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(0.72);
    opacity: 0.72;
  }
}

@media (min-width: 1440px) {
  .app-shell {
    gap: 24px;
    padding-top: 32px;
  }

  .topbar {
    padding: 16px 22px;
  }

  .brand-logo {
    width: 250px;
    height: 88px;
    min-width: 250px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1.72fr) minmax(500px, 0.82fr);
    gap: 26px;
  }

  .upload-panel,
  .summary-panel,
  .report-panel {
    padding: 28px;
  }

  .drop-zone {
    min-height: 340px;
    padding: 42px;
  }

  .controls {
    grid-template-columns: minmax(320px, 1fr) minmax(320px, auto) minmax(170px, auto);
    gap: 16px;
  }

  .summary-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .download-actions {
    grid-column: 1 / -1;
  }

  .metric {
    min-height: 104px;
  }

  table {
    min-width: 1080px;
  }
}

@media (min-width: 1720px) {
  .workspace {
    grid-template-columns: minmax(0, 1.8fr) minmax(560px, 0.78fr);
  }

  .report-panel {
    padding-bottom: 30px;
  }
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topbar-copy {
    grid-column: 1 / -1;
    order: 3;
  }

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

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 32px, var(--max-width));
    padding-top: 18px;
  }

  .topbar {
    align-items: stretch;
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .brand-logo {
    width: 194px;
    height: 74px;
    min-width: 194px;
  }

  .server-chip {
    justify-self: start;
  }

  .topbar-copy {
    grid-column: auto;
  }

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

  .workspace::before {
    display: none;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, var(--max-width));
    padding-top: 12px;
  }

  .brand-lockup {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .brand-logo {
    width: 180px;
    height: 70px;
    min-width: 180px;
  }

  h1 {
    font-size: 2.52rem;
    line-height: 1;
  }

  .upload-panel,
  .summary-panel,
  .report-panel {
    padding: 17px;
  }

  .drop-zone {
    min-height: 230px;
    padding: 22px 16px;
  }

  .minify-options,
  .download-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
