:root {
  color-scheme: dark;
  --bg: #080a0f;
  --ink: #eef3f8;
  --muted: #9aa8b7;
  --line: #273140;
  --panel: rgba(17, 22, 31, 0.88);
  --panel-soft: rgba(255, 255, 255, 0.045);
  --accent: #34d399;
  --accent-ink: #ffffff;
  --danger: #fb7185;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(52, 211, 153, 0.16), transparent 34%),
    radial-gradient(circle at 82% 6%, rgba(96, 165, 250, 0.14), transparent 28%),
    linear-gradient(180deg, #0a0d14 0%, var(--bg) 56%, #05060a 100%);
  color: var(--ink);
}

.shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: var(--muted);
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 230px;
  border: 1px dashed #526174;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.dropzone.dragging {
  border-color: var(--accent);
  background: rgba(52, 211, 153, 0.12);
  transform: translateY(-1px);
}

.dropzone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.drop-title {
  display: block;
  font-size: 25px;
  font-weight: 700;
}

.drop-copy {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.file-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.file-row-primary {
  border-color: rgba(52, 211, 153, 0.42);
  background: rgba(52, 211, 153, 0.12);
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}

.file-meta {
  color: var(--muted);
  font-size: 14px;
}

.settings {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

input,
select,
textarea,
button {
  border-radius: 8px;
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
}

input,
select,
button {
  min-height: 44px;
}

textarea {
  min-height: 96px;
  padding-block: 10px;
  resize: vertical;
}

button {
  border: 0;
  padding: 0 18px;
  background: var(--accent);
  color: #06110d;
  font-weight: 750;
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease, border-color 150ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
}

.secondary.active,
.copied {
  border-color: var(--accent);
  background: rgba(52, 211, 153, 0.14);
  color: var(--accent);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.compact {
  padding-inline: 14px;
}

.primary-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
}

.progress,
.result {
  margin-top: 18px;
}

.shell > .progress {
  width: 100%;
}

.bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--accent);
}

.result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.result-note {
  margin-top: 8px;
  font-size: 14px;
}

.message {
  margin: 18px 0 4px;
  padding: 13px 14px;
  border-left: 3px solid var(--accent);
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.advanced {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.028);
}

.advanced-group {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.advanced-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.advanced-heading::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.advanced-wide {
  grid-column: 1 / -1;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

.warning {
  color: #fbbf24;
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 920px);
    padding: 10px 0;
  }

  .panel {
    padding: 18px;
  }

  .brand,
  .result,
  .advanced {
    grid-template-columns: 1fr;
    display: grid;
  }

  .primary-actions {
    display: grid;
  }

  .input-action {
    grid-template-columns: 1fr;
  }

  .brand {
    align-items: start;
  }
}
