/* 미디어 컨버터 v2 스타일: FIT(Wanted Design System) 토큰 기반 라이트 테마 */
* { box-sizing: border-box; margin: 0; }

:root {
  --bg: #FBFBFB;
  --fg: #141415;
  --primary: #0066FF;
  --primary-hover: #005EEB;
  --primary-active: #0054D1;
  --blue-96: #EAF2FE;
  --blue-90: #C9DEFE;
  --blue-99: #F7FBFF;
  --line: #E1E2E4;
  --n-96: #EAEBEC;
  --n-94: #E1E2E4;
  --n-92: #DBDCDF;
  --n-80: #C2C4C8;
  --n-70: #AEB0B6;
  --n-60: #989BA2;
  --n-50: #70737C;
  --n-40: #5A5C63;
  --n-30: #46474C;
  --n-22: #2E2F33;
  --n-20: #292A2D;
  --n-18: #212225;
  --n-15: #1B1C1E;
  --n-12: #171719;
  --n-10: #141415;
  --success: #00BF40;
  --danger: #E5484D;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Wanted Sans Variable', 'Pretendard Variable', Pretendard, -apple-system, sans-serif;
  --radius-lg: 20px;
  --radius-md: 12px;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 5px 14px -3px rgba(0, 102, 255, 0.5);
}
.brand-mark svg { width: 21px; height: 21px; }

.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  white-space: nowrap;
}

.brand-sub {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--primary);
  white-space: nowrap;
}

.ttabs { display: flex; align-items: center; gap: 8px; }

.ttab {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  color: var(--n-40);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.ttab svg { width: 17px; height: 17px; flex: 0 0 auto; }
.ttab:hover { background: var(--n-96); color: var(--n-20); }
.ttab.on { background: var(--blue-96); color: var(--primary); }

.safe-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--n-96);
  font-size: 12px;
  font-weight: 600;
  color: var(--n-30);
  white-space: nowrap;
}
.safe-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- Page / Hero ---------- */
.page { max-width: 1000px; margin: 0 auto; padding: 0 24px 80px; }

.hero { padding-top: 28px; }
.eyebrow {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--primary);
}
.hero-title {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--n-10);
}
.hero-title em { font-style: normal; color: var(--primary); }
.hero-desc {
  margin-top: 10px;
  max-width: 540px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--n-40);
}
.rule { height: 1px; background: var(--line); margin-top: 24px; }

/* ---------- Dropzone ---------- */
.updrop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 24px;
  padding: 32px 40px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.updrop:hover { border-color: var(--primary); background: var(--blue-99); }
.updrop.dragging { border-color: var(--primary); background: var(--blue-99); box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.08); }

.updrop-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--blue-96);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.updrop-icon svg { width: 30px; height: 30px; }

.dz-title { font-size: 16px; font-weight: 800; color: var(--n-20); }
.dz-sub { margin-top: 4px; font-size: 13px; line-height: 1.6; color: var(--n-50); }

.dz-btn { flex: 0 0 auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  user-select: none;
}
.btn-primary { background: var(--primary); color: #fff; height: 44px; padding: 0 20px; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { background: var(--primary-active); }
.btn-primary:disabled { background: var(--n-80); cursor: default; }

.btn-dark { background: var(--n-10); color: #fff; height: 36px; padding: 0 16px; border-radius: 10px; font-size: 13px; }
.btn-dark:hover { background: var(--n-22); }
.btn-dark:disabled { background: var(--n-70); cursor: default; }

.btn-outline {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--n-40);
  height: 36px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 13px;
}
.btn-outline:hover { border-color: var(--n-70); color: var(--n-20); }

.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 9px; }
.btn-x {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--n-50);
  display: grid;
  place-items: center;
}
.btn-x:hover { background: var(--n-96); color: var(--n-10); }
.btn-x svg { width: 14px; height: 14px; }

/* ---------- Engine status ---------- */
.engine-status {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--n-50);
}
.engine-status.show { display: flex; }
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--blue-90);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Control bar ---------- */
.controlbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 28px 48px;
  margin-top: 24px;
  padding: 24px 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.opt-block { display: flex; flex-wrap: wrap; gap: 28px 48px; }
.opt-block.hidden { display: none; }

.cg { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cglabel { display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 700; color: var(--n-20); }
.cgval { font-size: 13px; font-weight: 800; color: var(--primary); }
.cgsub { font-size: 12px; font-weight: 400; color: var(--n-60); }
.cgsub.required { color: var(--primary); font-weight: 700; }

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 220px;
  height: 4px;
  border-radius: 2px;
  background: var(--n-94);
  outline: none;
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  cursor: grab;
}
.slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  cursor: grab;
}
.cg-range-ends { display: flex; justify-content: space-between; width: 220px; font-size: 11px; color: var(--n-60); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip {
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  font-family: var(--font);
}
.fchip:hover { border-color: var(--primary); }
.fchip .t { display: block; font-size: 14px; font-weight: 800; color: var(--n-20); line-height: 1.2; }
.fchip .s { display: block; margin-top: 3px; font-size: 11px; color: var(--n-60); line-height: 1.2; }
.fchip.active { border-color: var(--primary); background: var(--blue-96); }
.fchip.active .t { color: var(--primary); }

.nf { display: flex; align-items: center; gap: 8px; }
.nf-box {
  width: 110px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  color: var(--n-20);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.nf-box:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12); }
.nf-box::placeholder { color: var(--n-70); font-weight: 500; }
.nf-suffix { font-size: 13px; font-weight: 700; color: var(--n-40); }
.nf-tilde { color: var(--n-70); }

/* ---------- Convert button ---------- */
.convert-btn { width: 100%; height: 52px; margin-top: 24px; border-radius: 14px; font-size: 15px; }

/* ---------- Results ---------- */
.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  margin-bottom: 16px;
}
.t-title-3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--n-10);
}
.results-head h2 span { color: var(--primary); }

.summary {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
  padding: 24px 28px;
  background: var(--n-10);
  border-radius: var(--radius-lg);
  color: #fff;
}
.summary-num {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--success);
  white-space: nowrap;
}
.summary-meta { font-size: 13px; line-height: 1.7; color: var(--n-70); }
.summary-meta b { color: #fff; font-weight: 700; }
.summary-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.tag {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--n-22);
  color: var(--n-96);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 16px; }

.pcard {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.pcard:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06); }

.pcard-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--n-15);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.pcard-thumb video,
.pcard-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard-thumb.audio { background-image: conic-gradient(var(--n-96) 0 25%, #fff 0 50%, var(--n-96) 0 75%, #fff 0); background-size: 16px 16px; }
.pcard-thumb.audio svg { width: 34px; height: 34px; color: var(--n-80); }

.pcard-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(20, 20, 21, 0.85);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.pcard-badge.good { background: var(--success); }
.pcard-badge.bad { background: var(--danger); }

.pcard-state {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(20, 20, 21, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.pcard-state.show { display: flex; }
.pcard-state .pct { font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.pcard-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
}
.pcard-progress[hidden] { display: none; }
.pcard-progress i { display: block; height: 100%; background: var(--primary); width: 0; transition: width 0.2s; }
.pcard-audio { width: 100%; height: 34px; display: block; }
.pcard-audio[hidden] { display: none; }

.pcard-body { display: flex; flex-direction: column; gap: 8px; padding: 14px; flex: 1; }
.pcard-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--n-10);
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pcard-meta { font-size: 12px; line-height: 1.5; color: var(--n-60); }
.pcard-meta .saved { color: var(--success); font-weight: 700; }
.pcard-err {
  font-size: 11px;
  line-height: 1.5;
  color: var(--danger);
  background: #FDF1F2;
  border-radius: 8px;
  padding: 8px 10px;
  word-break: break-word;
  white-space: pre-wrap;
}
.pcard-actions { display: flex; gap: 8px; margin-top: auto; }
.pcard-actions .btn { flex: 1; }

/* ---------- Empty state ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-top: 48px;
  padding: 60px 24px;
  border: 1px dashed var(--n-92);
  border-radius: var(--radius-lg);
  background: #fff;
}
.empty.hidden { display: none; }
.empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--n-96);
  color: var(--n-70);
  display: grid;
  place-items: center;
}
.empty-icon svg { width: 26px; height: 26px; }
.empty p { font-size: 13px; line-height: 1.6; color: var(--n-60); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; }
.site-footer__inner {
  max-width: 1000px; margin: 0 auto; padding: 28px 24px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.site-footer__copy {
  display: flex; flex-direction: column; gap: 4px;
  font: 500 12.5px/1.5 var(--font); color: var(--n-60);
}
.site-footer__email {
  font: 600 14px/1.5 var(--font); color: var(--primary); text-decoration: none;
  margin-left: auto;
}
.site-footer__links { display: flex; gap: 16px; }
.site-footer__links a {
  font: 500 14px/1.5 var(--font); color: var(--n-60); text-decoration: none;
}
.site-footer__links a:hover { color: var(--primary); }
@media (max-width: 720px) {
  .site-footer__inner { flex-direction: column; align-items: center; gap: 8px; text-align: center; }
  .site-footer__email { margin-left: 0; }
}

/* ---------- 법적 문서 페이지 (개인정보처리방침 / 이용약관) ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: 48px 24px 80px; }
.legal h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--n-10);
}
.legal .updated { margin-top: 8px; font-size: 12px; color: var(--n-60); }
.legal .rule { margin-top: 20px; }
.legal h2 {
  margin-top: 36px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--n-10);
}
.legal p, .legal li { font-size: 14px; line-height: 1.8; color: var(--n-40); }
.legal p { margin-top: 12px; }
.legal ul { margin-top: 12px; padding-left: 20px; }
.legal li { margin-top: 4px; }
.legal a { word-break: break-all; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  max-width: min(90vw, 480px);
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--n-10);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.hidden { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(-6px); }

/* ---------- 광고 슬롯 ---------- */
.ad-slot {
  position: relative;
  max-width: 728px;
  min-height: 90px;
  margin: 20px auto 0;
  border: 1.5px dashed var(--n-92);
  border-radius: var(--radius-md);
  background: var(--n-96);
  display: grid;
  place-items: center;
}
.ad-slot.ad-rect { max-width: 300px; min-height: 250px; }
.ad-tag {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--n-70);
}
.ad-body { padding: 24px; font-size: 12px; font-weight: 600; color: var(--n-70); text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .page { max-width: 720px; }
  footer { max-width: 720px; }
}

/* 상단바: 라벨+세이프필까지 포함 시 ~876px 필요 → 860px부터 컴팩트하게 */
@media (max-width: 860px) {
  .topbar { padding: 0 16px; gap: 16px; }
  .brand-sub { display: none; }
  .safe-pill { display: none; }
  .ttabs { gap: 4px; }
  .ttab { padding: 0 10px; }
}

@media (max-width: 720px) {
  .tlabel { display: none; }
  .hero { padding-top: 20px; }
  .hero-title { font-size: 26px; }
  .hero-desc { font-size: 14px; }
  .updrop { flex-direction: column; text-align: center; padding: 28px 20px; }
  .dz-btn { width: 100%; }
  .controlbar { padding: 20px; }
  .slider, .cg-range-ends { width: 100%; }
  .summary { flex-wrap: wrap; }
  .summary-tags { margin-left: 0; }
  .foot { flex-direction: column; }
}

@media (max-width: 420px) {
  .safe-pill { display: none; }
  .brand-name { font-size: 16px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .ttab { padding: 0; width: 38px; justify-content: center; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
