:root {
  --panel: #ffffff;
  --ink: #182230;
  --muted: #5f6f86;
  --line: #d6deea;
  --primary: #0b63f6;
  --primary-ink: #ffffff;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans KR", "Segoe UI", sans-serif;
  background: linear-gradient(140deg, #eef4ff 0%, #f9fbff 45%, #f1f7ff 100%);
  color: var(--ink);
}

.site-header {
  border-bottom: 1px solid #dbe4f3;
  background: #ffffffde;
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-weight: 800;
  color: #17345f;
  text-decoration: none;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.main-nav a {
  text-decoration: none;
  color: #24416d;
  font-size: 14px;
}

.app {
  max-width: 1200px;
  margin: 28px auto 40px;
  padding: 0 16px;
}

h1 {
  margin: 0 0 6px;
}

.subtitle {
  margin: 0 0 20px;
  color: var(--muted);
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.panel {
  min-height: 640px;
  height: 100%;
}

.bridge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 640px;
}

.move-btn {
  white-space: nowrap;
  padding: 11px 12px;
}

.hint {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.drop-zone {
  border: 2px dashed #abc3ef;
  background: #f7faff;
  border-radius: 10px;
  min-height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
  color: #35507e;
  font-size: 16px;
  white-space: nowrap;
}

.drop-zone.dragover {
  border-color: #0b63f6;
  background: #eaf2ff;
}

button {
  border: none;
  background: var(--primary);
  color: var(--primary-ink);
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}

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

button.ghost {
  background: #eef2fb;
  color: #1c2e4a;
}

.status {
  margin: 14px 0;
  color: var(--muted);
}

h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.file-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
}

.file-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.file-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.file-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

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

.file-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.remove-btn {
  background: #fde9e7;
  color: var(--danger);
  padding: 6px 9px;
  font-size: 13px;
}

.download-link {
  color: #0a56d4;
  text-decoration: none;
  font-weight: 600;
}

.download-link.hidden {
  display: none;
}

.merge-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 10px;
  min-height: 420px;
  align-content: start;
}

.merge-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9fbff;
  padding: 8px;
  min-height: 98px;
  position: relative;
  cursor: grab;
  user-select: none;
}

.merge-item.dragging {
  opacity: 0.4;
}

.convert-empty,
.merge-empty {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.merge-empty {
  grid-column: 1 / -1;
}

.merge-order {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0b63f6;
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.merge-icon {
  font-size: 30px;
  text-align: center;
  margin-top: 12px;
}

.merge-name {
  margin-top: 6px;
  font-size: 12px;
  color: #1f334f;
  text-align: center;
  overflow-wrap: anywhere;
}

.info-section h2 {
  margin-bottom: 10px;
}

.info-section h3 {
  margin: 14px 0 6px;
  font-size: 16px;
}

.info-section p,
.info-section li {
  color: #31455f;
  line-height: 1.55;
}

.site-footer {
  border-top: 1px solid #dbe4f3;
  background: #ffffffc7;
}

.footer-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 16px 26px;
  color: #50627a;
  font-size: 14px;
}

.footer-inner p {
  margin: 8px 0 0;
}

.footer-inner a {
  color: #2c4b79;
  margin-right: 10px;
  text-decoration: none;
}

.simple-page {
  max-width: 860px;
}

.legal h1 {
  margin-bottom: 8px;
}

.legal p,
.legal li {
  line-height: 1.6;
  color: #2d4058;
}

@media (max-width: 700px) {
  .app {
    margin-top: 24px;
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .bridge {
    min-height: auto;
  }

  .panel {
    min-height: auto;
  }

  .file-item-top {
    flex-direction: column;
    align-items: flex-start;
  }
}
