:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: #050505;
  color: #f8fafc;
  --line: rgba(255, 255, 255, 0.12);
  --muted: #a7b0c0;
  --muted-soft: #778197;
  --white: #ffffff;
  --silver: #d8dbe1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 5%, rgba(255, 255, 255, 0.1), transparent 28rem),
    radial-gradient(circle at 85% 18%, rgba(148, 163, 184, 0.12), transparent 30rem),
    linear-gradient(180deg, #060910 0%, #05070d 45%, #040404 100%);
}

.shell {
  display: grid;
  gap: 34px;
  min-height: 100vh;
  padding: 26px 20px 44px;
}

.site-header,
.panel {
  margin: 0 auto;
  width: min(100%, 980px);
}

.site-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.brand-mark img {
  display: block;
  height: auto;
  width: clamp(170px, 18vw, 220px);
}

.back-link,
.ghost-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--white);
  font-size: 13px;
  font-weight: 800;
  padding: 12px 15px;
  text-decoration: none;
  text-transform: uppercase;
}

.panel {
  align-self: start;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(6, 9, 16, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.35);
  padding: 34px;
}

.brand {
  color: var(--silver);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.22em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

h1 {
  color: var(--white);
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1;
  margin: 0;
}

.intro {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
  margin: 18px 0 28px;
  max-width: 680px;
}

.splitter {
  display: grid;
  gap: 20px;
}

.dropzone {
  align-items: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  min-height: 160px;
  padding: 28px;
  text-align: center;
}

.dropzone input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.drop-title {
  color: var(--white);
  font-size: 22px;
  font-weight: 800;
}

.drop-subtitle {
  color: var(--muted-soft);
  font-size: 14px;
  margin-top: 8px;
}

.mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.mode-row label {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.preview-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.preview-actions {
  display: flex;
  gap: 10px;
}

.preview-head strong {
  color: var(--silver);
}

.preview-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  min-height: 76px;
}

.preview-item {
  align-items: center;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
    #080b12;
  background-size: 18px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  min-height: 150px;
  overflow: hidden;
}

.preview-item img {
  display: block;
  max-height: 170px;
  max-width: 100%;
  object-fit: contain;
}

.controls {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}

label {
  color: var(--silver);
  font-size: 14px;
  font-weight: 700;
}

input,
select,
button {
  border-radius: 8px;
  font: inherit;
  width: 100%;
}

.controls input,
.controls select {
  background: #050814;
  border: 1px solid var(--line);
  color: var(--white);
  margin-top: 7px;
  padding: 12px;
}

button {
  background: var(--white);
  border: 0;
  color: #080808;
  cursor: pointer;
  font-weight: 800;
  padding: 15px 18px;
  text-transform: uppercase;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  max-width: 130px;
  padding: 10px 14px;
}

button:disabled {
  background: #8a93a3;
  cursor: wait;
}

.status {
  color: var(--muted);
  margin: 0;
  min-height: 22px;
}

@media (max-width: 680px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .back-link {
    text-align: center;
    width: 100%;
  }

  .panel {
    padding: 24px;
  }

  .preview-head {
    align-items: stretch;
    flex-direction: column;
  }

  .preview-actions {
    flex-direction: column;
  }

  .ghost-button {
    max-width: none;
  }
}
