:root {
  color-scheme: dark;
  --bg: #000000;
  --ink: #e8eaed;
  --muted: #9aa0a6;
  --line: #303030;
  --line-soft: #171717;
  --panel: #000000;
  --accent: #ff8a00;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Arial, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 21px;
  color: var(--ink);
  background: var(--bg);
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 36px 16px;
  background: var(--bg);
}

.panel {
  width: min(100%, 540px);
  min-height: min(860px, calc(100vh - 72px));
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 34px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  padding: 42px 38px;
}

.screen {
  min-height: 100%;
}

.brand-title {
  margin: 0;
  color: var(--ink);
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.drop-screen {
  display: grid;
  grid-template-rows: auto minmax(1px, auto) auto 1fr auto auto;
  gap: 22px;
}

.pair-screen {
  display: grid;
  align-content: center;
  gap: 18px;
}

.pair-output {
  display: grid;
  min-height: 340px;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: #080808;
  color: var(--accent);
  font-size: clamp(49px, 12vw, 79px);
  font-weight: 800;
  letter-spacing: 0;
}

.upload-box {
  display: grid;
  grid-template-columns: 1fr 74px;
  gap: 16px;
}

input[type="file"] {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.icon-tile,
.icon-button {
  display: grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: #080808;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}

.icon-tile {
  min-height: 184px;
  gap: 16px;
  border-style: dashed;
  border-width: 2px;
  color: var(--muted);
}

.icon-tile.is-dragging {
  border-color: var(--accent);
  background: #14100a;
}

.icon-button {
  width: 74px;
  min-height: 74px;
}

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

.icon-tile span {
  color: var(--muted);
  font-size: 20px;
  font-weight: 600;
}

.icon-button svg {
  width: 34px;
  height: 34px;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-actions {
  display: grid;
  grid-template-rows: 1fr 1fr;
  min-height: 184px;
  gap: 14px;
}

.stack-button {
  width: 74px;
  min-height: 0;
  color: var(--muted);
}

.stack-button svg {
  width: 30px;
  height: 30px;
}

.primary-button {
  background: #eeeeee;
  border-color: #eeeeee;
  color: #111111;
}

.primary-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.status {
  min-height: 1px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.4;
}

.file-summary {
  min-height: 26px;
  color: var(--muted);
  font-size: 21px;
  font-weight: 600;
}

.file-area {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 160px;
}

.empty-state {
  min-height: 1px;
}

.file-list {
  display: grid;
  gap: 14px;
}

.file-item {
  display: grid;
  grid-template-columns: 70px 1fr 38px;
  align-items: center;
  gap: 16px;
  min-height: 86px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: #080808;
}

.file-preview {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  color: var(--accent);
  background: #000;
}

.file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-preview svg {
  width: 28px;
  height: 28px;
}

.file-details {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.file-name {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
}

.file-size {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.2;
}

.file-name-input {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  padding: 4px 0;
}

.file-name-input:focus {
  border-color: var(--accent);
  outline: none;
  background: #000;
}

.download-link {
  width: 38px;
  min-height: 28px;
  color: var(--muted);
}

.delete-link {
  color: var(--danger);
}

.download-link svg {
  width: 20px;
  height: 20px;
}

.save-panel {
  display: grid;
  grid-template-columns: auto 1fr 64px;
  align-items: center;
  gap: 16px;
}

.zip-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: 0 18px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: #080808;
  color: var(--muted);
  font-size: 20px;
  font-weight: 800;
}

.zip-option input {
  width: 18px;
  height: 18px;
  accent-color: #eeeeee;
}

.folder-input {
  min-width: 0;
  min-height: 64px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: #080808;
  color: var(--ink);
  font: inherit;
  font-size: 20px;
  padding: 0 20px;
}

.folder-input:focus {
  border-color: var(--accent);
  outline: none;
}

.download-all {
  width: 64px;
  min-height: 64px;
  color: var(--muted);
}

.danger-button {
  display: flex;
  width: 100%;
  min-height: 64px;
  gap: 14px;
  border-color: rgba(239, 68, 68, 0.45);
  color: var(--danger);
  font-size: 22px;
  font-weight: 800;
}

.danger-button svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 520px) {
  .app {
    align-items: stretch;
    padding: 18px 10px;
  }

  .panel {
    min-height: calc(100vh - 36px);
    grid-template-rows: auto 1fr;
    gap: 24px;
    padding: 28px 18px;
  }

  .upload-box {
    grid-template-columns: 1fr 74px;
    margin-top: 0;
  }

  .icon-tile,
  .upload-actions {
    min-height: 210px;
  }

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