:root {
  --bg: #07080c;
  --bg2: #0c0e14;
  --ink: #f2f4f8;
  --muted: #9aa3b5;
  --line: rgba(255, 255, 255, 0.1);
  --line2: rgba(255, 255, 255, 0.16);
  --glass: rgba(22, 25, 34, 0.55);
  --glass2: rgba(255, 255, 255, 0.04);
  --red: #e11d2e;
  --red-glow: rgba(225, 29, 46, 0.45);
  --gold: #e8b64c;
  --ok: #3dd68c;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 22px;
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(225, 29, 46, 0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(232, 182, 76, 0.08), transparent 50%),
    linear-gradient(180deg, var(--bg), #05060a 60%, #080a10);
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}
.orb-a {
  width: 420px; height: 420px;
  left: -80px; top: 120px;
  background: rgba(225, 29, 46, 0.16);
}
.orb-b {
  width: 380px; height: 380px;
  right: -60px; bottom: 40px;
  background: rgba(232, 182, 76, 0.1);
}
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.glass {
  background: linear-gradient(145deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border-radius: var(--radius);
}

.glass-inset {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 22px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo {
  height: 42px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.4));
}
.brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-text strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}
.brand-text span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(225, 29, 46, 0.45);
  background: rgba(225, 29, 46, 0.12);
  color: #ffb4ba;
}
.pill.soft {
  border-color: var(--line2);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 18px;
  margin-bottom: 18px;
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .brand-logo { height: 34px; }
}

.panel { padding: 22px; }
.drop-panel {
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.drop-panel.dragover {
  border-color: rgba(225, 29, 46, 0.7);
  box-shadow: var(--shadow), 0 0 0 1px rgba(225, 29, 46, 0.35), 0 0 40px var(--red-glow);
  transform: translateY(-2px);
}
.drop-inner {
  text-align: center;
  padding: 24px 12px;
  max-width: 420px;
}
.drop-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 18px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, rgba(225,29,46,0.35), rgba(0,0,0,0.35));
  border: 1px solid rgba(225, 29, 46, 0.35);
  box-shadow: 0 12px 30px rgba(225, 29, 46, 0.2);
}
.drop-icon img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}
.drop-inner h1 {
  margin: 0 0 10px;
  font-size: 26px;
  letter-spacing: -0.03em;
}
.drop-inner p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}
.drop-inner em { color: #ffd0d4; font-style: normal; font-weight: 600; }

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  border-radius: 14px;
  padding: 12px 18px;
  transition: transform 0.15s, filter 0.15s, opacity 0.15s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; filter: none; }
.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #e11d2e, #a50f1c);
  box-shadow: 0 10px 28px rgba(225, 29, 46, 0.35);
}
.btn.wide { width: 100%; }
.btn.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #1a1408;
  background: linear-gradient(135deg, #f0c15a, #d49a2a);
  box-shadow: 0 10px 28px rgba(232, 182, 76, 0.28);
  margin-top: 12px;
}

.file-chip {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--line2);
  max-width: 100%;
}
.file-chip .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
  flex-shrink: 0;
}
#fileName {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}
.chip-x {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.hidden { display: none !important; }

.form-panel h2 {
  margin: 0 0 16px;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 7px; }
.form label > span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.form input[type="text"],
.form select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: rgba(0,0,0,0.35);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 12px 13px;
  outline: none;
}
.form input[type="text"]:focus,
.form select:focus {
  border-color: rgba(225, 29, 46, 0.55);
  box-shadow: 0 0 0 3px rgba(225, 29, 46, 0.15);
}
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }

.range-label input[type="range"] {
  width: 100%;
  accent-color: var(--red);
}
.range-label strong { color: var(--gold); font-variant-numeric: tabular-nums; }

.check {
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
  font-size: 13px;
  color: var(--muted);
}
.check input { width: 16px; height: 16px; accent-color: var(--red); }

.status {
  margin-top: 16px;
  padding: 12px 14px;
}
.status-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--muted);
}
.status-dot.busy {
  background: var(--gold);
  box-shadow: 0 0 12px rgba(232,182,76,0.7);
  animation: pulse 1s infinite;
}
.status-dot.ok { background: var(--ok); box-shadow: 0 0 12px rgba(61,214,140,0.6); }
.status-dot.err { background: var(--red); box-shadow: 0 0 12px var(--red-glow); }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.progress {
  margin-top: 10px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--red), var(--gold), transparent);
  animation: slide 1.1s linear infinite;
}
@keyframes slide {
  from { transform: translateX(-120%); }
  to { transform: translateX(320%); }
}

.result { margin-top: 14px; }
.result-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}
.result-card strong { display: block; font-size: 14px; margin-bottom: 4px; }
.result-card p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }

.info { padding: 18px 20px; margin-bottom: 18px; }
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 760px) { .info-grid { grid-template-columns: 1fr; } }
.info h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #ffb4ba;
  letter-spacing: 0.02em;
}
.info p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.info code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #f0c15a;
  background: rgba(0,0,0,0.28);
  padding: 1px 6px;
  border-radius: 6px;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  opacity: 0.9;
}
.footer img { opacity: 0.9; }
