/* ===== YN SOLUTION 테마 (ycb-auto UI와 동일 팔레트) ===== */
:root {
  --bg: #070a18;
  --panel: #111827;
  --panel-2: #151f33;
  --line: #2e3a66;
  --line-soft: #202b4a;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --faint: #64748b;
  --blue: #38bdf8;
  --green: #34d399;
  --orange: #f59e0b;
  --red: #f87171;
  --purple: #a78bfa;
  --pink: #f472b6;
  --cyan-glow: 0 0 18px rgba(56, 189, 248, .16);
  --purple-glow: 0 0 18px rgba(167, 139, 250, .14);
  --shadow: 0 22px 60px rgba(0, 0, 0, .38);
  --brand-grad: linear-gradient(90deg, #e0f2fe, #c4b5fd 55%, #f0abfc);
}

* { box-sizing: border-box; }

/* hidden 속성이 display:flex 등에 덮이지 않도록 강제 */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 30% 0%, rgba(56, 189, 248, .14), transparent 38%),
    radial-gradient(circle at 85% 12%, rgba(167, 139, 250, .10), transparent 40%),
    linear-gradient(180deg, #0b1220 0%, #080d18 54%, #060914 100%), var(--bg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", Roboto, sans-serif;
  word-break: keep-all; /* 한국어 어절 단위 줄바꿈 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ===== 아이콘 시스템 (스트로크 SVG) ===== */
.ic { width: 20px; height: 20px; display: inline-block; vertical-align: middle; flex-shrink: 0; }
svg.ic, svg.ic-x, svg.star { display: block; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { letter-spacing: -.4px; }
h2 { font-size: clamp(24px, 3.4vw, 34px); text-align: center; margin: 0 0 34px; }

.gradient-text {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ===== 브랜드 로고 (YN SOLUTION — 자동화 프로그램 UI와 동일) ===== */
.brand {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: .3px;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand .brand-text span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.brand-text { margin-top: 0; }

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #dc2626, #f43f5e);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px rgba(244, 63, 94, .35);
  flex-shrink: 0;
  margin-top: 0;
}

/* ===== 헤더 ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 13, 30, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.nav { display: flex; gap: 6px; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 10px;
  transition: .15s;
}
.nav a:hover { color: var(--text); background: rgba(56, 189, 248, .1); }
.header-right { display: flex; align-items: center; gap: 8px; }
.lang-globe { display: inline-flex; color: var(--muted); }
.lang-globe .ic { width: 18px; height: 18px; }
.lang-select {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 13px;
  cursor: pointer;
  max-width: 150px;
}
.lang-select:hover { border-color: var(--blue); }
.lang-select:focus { outline: none; border-color: var(--blue); box-shadow: var(--cyan-glow); }
.lang-select option { background: var(--panel); color: var(--text); }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  font-size: 18px;
  padding: 6px 12px;
  cursor: pointer;
}

/* ===== 버튼 ===== */
.btn {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: .15s;
}
.btn:hover { border-color: var(--blue); box-shadow: var(--cyan-glow); }
.btn.primary {
  background: linear-gradient(90deg, #0ea5e9, #6366f1 60%, #a855f7);
  border: none;
  color: #fff;
}
.btn.primary:hover { filter: brightness(1.12); box-shadow: var(--purple-glow); }
.btn.big { padding: 14px 30px; font-size: 16px; border-radius: 14px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== 히어로 ===== */
.hero { padding: 64px 0 40px; text-align: center; }
.hero h1 { font-size: clamp(28px, 5vw, 48px); margin: 0 0 14px; }
.hero-sub { color: var(--muted); font-size: clamp(14px, 2vw, 17px); line-height: 1.7; margin: 0 0 30px; }
.hero-note { color: var(--muted); font-size: 13px; margin-top: 16px; }

/* ===== 변환 박스 ===== */
.convert-box {
  background: linear-gradient(180deg, rgba(21, 31, 51, .9), rgba(13, 19, 36, .9));
  border: 2px dashed var(--line);
  border-radius: 22px;
  padding: 40px 26px;
  box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s;
}
.convert-box.dragover {
  border-color: var(--blue);
  box-shadow: var(--cyan-glow), var(--shadow);
}
.convert-icon {
  width: 60px; height: 60px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 18px; color: var(--blue);
  background: linear-gradient(135deg, rgba(14, 165, 233, .16), rgba(168, 85, 247, .16));
  border: 1px solid var(--line-soft);
}
.convert-icon .ic { width: 30px; height: 30px; }
.convert-box.dragover .convert-icon { color: var(--text); transform: translateY(-2px); }
.drop-hint { color: var(--muted); margin: 18px 0 0; font-size: 15px; }
.drop-hint span { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }

/* 파일 목록 */
.convert-list { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 12px 16px;
}
.file-thumb {
  width: 44px; height: 44px;
  border-radius: 10px;
  object-fit: contain;
  background: repeating-conic-gradient(#1e293b 0% 25%, #0f172a 0% 50%) 0 0 / 16px 16px;
  flex-shrink: 0;
}
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.file-status { font-size: 12px; font-weight: 700; flex-shrink: 0; }
.file-status.ready { color: var(--muted); }
.file-status.working { color: var(--blue); }
.file-status.done { color: var(--green); }
.file-status.error { color: var(--red); }
.file-row .btn { padding: 8px 14px; font-size: 13px; flex-shrink: 0; }
.file-remove {
  background: none; border: none; color: var(--faint);
  cursor: pointer; padding: 6px; flex-shrink: 0; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: .15s;
}
.file-remove .ic-x { width: 16px; height: 16px; }
.file-remove:hover { color: var(--red); background: rgba(248, 113, 113, .1); }

/* 변환 액션 */
.convert-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}
.target-select { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.seg { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg-btn {
  background: none; border: none; color: var(--muted);
  padding: 8px 18px; border-radius: 9px;
  font-size: 14px; font-weight: 700; cursor: pointer; transition: .15s;
}
.seg-btn.active { background: linear-gradient(90deg, #0ea5e9, #6366f1); color: #fff; }
.convert-actions-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* 품질 슬라이더 (JPG/WebP) */
.quality-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  color: var(--muted);
  font-size: 14px;
}
.quality-row input[type="range"] {
  flex: 1;
  max-width: 260px;
  accent-color: var(--blue);
  cursor: pointer;
}
.quality-val { font-weight: 700; color: var(--text); min-width: 44px; }

/* 리사이즈 옵션 */
.resize-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; width: 100%; color: var(--muted); font-size: 14px; }
.resize-row .seg-btn { padding: 7px 14px; }
.resize-inputs { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.resize-inputs label { display: flex; align-items: center; gap: 6px; }
.resize-inputs input[type="number"] {
  width: 84px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 14px;
}
.resize-inputs input[type="number"]:focus { outline: none; border-color: var(--blue); box-shadow: var(--cyan-glow); }
.resize-x { color: var(--faint); }
.keepratio { cursor: pointer; }
.keepratio input { accent-color: var(--blue); }
/* ICO는 정사각 단일 크기 — 세로/비율유지 입력 숨김 */
.resize-inputs.ico-size .resize-x,
.resize-inputs.ico-size > label:nth-of-type(2),
.resize-inputs.ico-size label.keepratio { display: none; }

/* 편집(회전/반전/배경) */
.edit-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; width: 100%; }
.edit-tools { display: flex; align-items: center; gap: 6px; }
.icon-btn { padding: 9px; line-height: 0; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn .ic { width: 18px; height: 18px; }
.icon-btn.active { background: linear-gradient(90deg, #0ea5e9, #6366f1); border: none; color: #fff; }
.edit-state { color: var(--blue); font-weight: 700; font-size: 13px; min-width: 20px; }
.bg-field { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.bg-field input[type="color"] {
  width: 36px; height: 28px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); cursor: pointer; padding: 2px;
}

/* PWA 설치 버튼 */
.install-btn { padding: 7px 14px; font-size: 13px; }

/* 푸터 개인정보/약관 */
.footer-legal { border-top: 1px solid var(--line-soft); padding: 22px 20px; }
.footer-legal h4 { margin: 0 0 10px; font-size: 14px; color: var(--text); }
.footer-legal p { margin: 0 0 8px; color: var(--muted); font-size: 12.5px; line-height: 1.6; max-width: 920px; }
.footer-legal strong { color: var(--text); }

/* 404 페이지 */
.notfound { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 20px; }
.notfound-code { font-size: clamp(64px, 16vw, 120px); font-weight: 800; line-height: 1; }
.notfound-msg { color: var(--muted); font-size: 16px; margin: 0; }

/* ===== 특징 카드 ===== */
.features { padding: 40px 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 26px 22px;
  transition: .2s;
}
.card:hover { border-color: var(--line); transform: translateY(-3px); box-shadow: var(--cyan-glow); }
.feat-icon {
  width: 48px; height: 48px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px; color: var(--blue);
  background: linear-gradient(135deg, rgba(14, 165, 233, .15), rgba(168, 85, 247, .15));
  border: 1px solid var(--line-soft);
  transition: .2s;
}
.feat-icon .ic { width: 24px; height: 24px; }
.card:hover .feat-icon { color: var(--text); }
.card h3 { margin: 0 0 8px; font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }

/* ===== 사용 방법 ===== */
.howto { padding: 56px 0; }
.step { text-align: center; padding: 10px; }
.step-num {
  width: 46px; height: 46px;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-weight: 800; font-size: 18px;
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #a855f7);
  box-shadow: var(--purple-glow);
}
.step h3 { margin: 0 0 8px; font-size: 17px; }
.step p { color: var(--muted); font-size: 14px; line-height: 1.65; margin: 0; }

/* ===== 포맷 테이블 ===== */
.formats { padding: 40px 0 56px; }
.format-table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--line-soft); }
.format-table { width: 100%; border-collapse: collapse; background: var(--panel); min-width: 560px; }
.format-table th, .format-table td { padding: 14px 18px; text-align: left; font-size: 14px; }
.format-table th { background: var(--panel-2); color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); }
.format-table td { border-bottom: 1px solid var(--line-soft); color: var(--text); }
.format-table tr:last-child td { border-bottom: none; }
.format-table td:nth-child(3), .format-table td:nth-child(4) { color: var(--muted); }

/* ===== FAQ ===== */
.faq { padding: 20px 0 56px; }
.faq details {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  margin-bottom: 10px;
  overflow: hidden;
}
.faq summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute; right: 20px; top: 50%;
  transform: translateY(-50%);
  color: var(--blue); font-size: 18px; font-weight: 700;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0; padding: 0 20px 16px; color: var(--muted); font-size: 14px; line-height: 1.7; }

/* ===== 평점 ===== */
.rating { padding: 10px 0 60px; }
.rating-box {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 26px;
}
.rating-score {
  font-size: 46px; font-weight: 800;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.rating-stars { color: var(--orange); display: flex; gap: 3px; }
.rating-stars .star { width: 20px; height: 20px; }
.rating-box p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

/* ===== 푸터 ===== */
.footer { border-top: 1px solid var(--line-soft); background: rgba(8, 13, 30, .7); }
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 30px;
  padding-top: 40px;
  padding-bottom: 30px;
}
.footer-cols { display: flex; gap: 60px; }
.footer-cols h4 { margin: 0 0 12px; font-size: 14px; color: var(--text); }
.footer-cols a { display: block; color: var(--muted); text-decoration: none; font-size: 13px; margin-bottom: 8px; }
.footer-cols a:hover { color: var(--blue); }
.footer-copy { border-top: 1px solid var(--line-soft); padding-top: 18px; padding-bottom: 18px; }
.footer-copy p { margin: 0; color: var(--muted); font-size: 12px; text-align: center; }

/* ===== 토스트 알림 ===== */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(92vw, 480px);
}
.toast {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  white-space: pre-line;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-error { border-color: rgba(248, 113, 113, .55); color: #fecaca; }

/* 키보드 포커스 표시 */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ===== 반응형 ===== */
.br-m { display: none; }

@media (max-width: 820px) {
  .grid-3 { grid-template-columns: 1fr; }
  .nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: rgba(8, 13, 30, .97);
    border-bottom: 1px solid var(--line-soft);
    padding: 10px 20px 16px;
  }
  .nav.open { display: flex; }
  .nav-toggle { display: block; }
  .header-inner { position: relative; }
  .hero { padding: 44px 0 30px; }
  .convert-box { padding: 30px 16px; }
  .convert-actions { flex-direction: column; align-items: stretch; }
  .target-select { justify-content: space-between; }
  .convert-actions-btns { flex-direction: column; }
  .convert-actions-btns .btn { width: 100%; }
  .br-m { display: inline; }
  .file-row { flex-wrap: wrap; }
  .footer-cols { gap: 36px; }
}

@media (max-width: 420px) {
  .seg-btn { padding: 8px 12px; }
  .rating-box { flex-direction: column; text-align: center; gap: 8px; }
  .lang-select { max-width: 120px; }
}

/* 작은 화면 헤더 정돈 — 브랜드명 한 줄, 부가요소 숨김 */
.brand strong { white-space: nowrap; }
@media (max-width: 560px) {
  .brand-text span { display: none; }
  .lang-globe { display: none; }
  .header-right { gap: 6px; }
}

/* ===== RTL (아랍어) ===== */
[dir="rtl"] body { word-break: normal; }
[dir="rtl"] .file-info,
[dir="rtl"] .convert-list { text-align: right; }
[dir="rtl"] .format-table th,
[dir="rtl"] .format-table td { text-align: right; }
[dir="rtl"] .faq summary { padding-right: 20px; padding-left: 44px; }
[dir="rtl"] .faq summary::after { right: auto; left: 20px; }

/* =====================================================================
   세련화 패스 — 타이포·간격·컴포넌트 마감 (professional polish)
   ===================================================================== */

/* 타이포그래피 리듬 */
h1, h2, h3, h4 { font-weight: 800; }
h2 { letter-spacing: -.6px; margin-bottom: 12px; }
.howto h2, .formats h2, .faq h2 { position: relative; }

/* 섹션 제목 아래 미세한 강조 라인 */
.howto h2::after, .formats h2::after, .faq h2::after {
  content: ""; display: block; width: 40px; height: 3px; margin: 14px auto 0;
  border-radius: 3px; background: linear-gradient(90deg, #0ea5e9, #a855f7);
  opacity: .9;
}

/* 헤더 — 더 또렷한 유리질감 */
.header { background: rgba(9, 14, 32, .72); backdrop-filter: blur(14px) saturate(1.2); }
.nav a { font-weight: 500; }
.nav a:hover { background: rgba(148, 163, 184, .10); color: var(--text); }

/* 히어로 — 제목 대비 강화, 서브 정돈 (상단 여백은 모바일 미디어쿼리 존중) */
@media (min-width: 821px) { .hero { padding-top: 72px; } }
.hero h1 { font-weight: 800; letter-spacing: -1.2px; line-height: 1.08; }
.hero-sub { max-width: 640px; margin-left: auto; margin-right: auto; }

/* 변환 박스 — 실선 테두리 + 절제된 그림자 */
.convert-box {
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(23, 33, 56, .72), rgba(13, 19, 36, .72));
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .6);
}
.convert-box.dragover { border-color: var(--blue); border-style: dashed; }

/* 특징 카드 — 얇은 하이라이트 테두리 + 부드러운 리프트 */
.card {
  background: linear-gradient(180deg, rgba(21, 31, 51, .55), rgba(17, 24, 39, .55));
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  padding: 28px 24px;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, .4);
  box-shadow: 0 24px 48px -28px rgba(56, 189, 248, .5);
}
.card h3 { font-size: 17px; letter-spacing: -.3px; }
.card p { color: var(--muted); }

/* 세그먼트 컨트롤 — 인셋 트랙 + 부드러운 활성 상태 */
.seg { background: rgba(9, 14, 30, .7); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .3); }
.seg-btn { transition: color .15s, background .15s; }
.seg-btn:not(.active):hover { color: var(--text); background: rgba(148, 163, 184, .08); }
.seg-btn.active { box-shadow: 0 4px 14px -4px rgba(99, 102, 241, .6); }

/* 기본 버튼 마감 */
.btn { border-radius: 12px; letter-spacing: -.2px; }
.btn.primary { box-shadow: 0 8px 22px -10px rgba(99, 102, 241, .8); }

/* 파일 행 — hover 강조, 썸네일 테두리 */
.file-row { transition: border-color .15s, background .15s; }
.file-row:hover { border-color: var(--line); }
.file-thumb { border: 1px solid var(--line-soft); }

/* 스텝 번호 — 링 강조 */
.step-num { box-shadow: 0 0 0 6px rgba(99, 102, 241, .08), var(--purple-glow); }

/* 포맷 테이블 — 행 hover */
.format-table tbody tr { transition: background .15s; }
.format-table tbody tr:hover td { background: rgba(56, 189, 248, .05); }

/* FAQ — hover */
.faq details { transition: border-color .15s; }
.faq details:hover { border-color: var(--line); }
.faq summary { font-weight: 600; }

/* 평점 박스 */
.rating-box { border-radius: 20px; background: linear-gradient(180deg, rgba(21, 31, 51, .5), rgba(17, 24, 39, .5)); }

/* 링크/셀렉트 포커스 일관성 */
input, select, button { font-family: inherit; }

/* ===== 광고 슬롯 (AdSense) ===== */
.ad-wrap { padding: 0 20px; }
.ad-slot { margin: 28px auto; text-align: center; max-width: 970px; }
.ad-label {
  display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 6px;
}
.ad-slot ins { display: block; }

/* ===== 추천 파트너 (제휴 마케팅) ===== */
.partners { padding: 44px 0; }
.partners-sub { text-align: center; color: var(--muted); margin: -22px auto 30px; max-width: 560px; font-size: 14px; }
.affiliate-disclosure { text-align: center; color: var(--muted); font-size: 12px; margin: -18px auto 26px; max-width: 660px; line-height: 1.6; }
.affiliate-slot { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.aff-banner {
  --accent: var(--blue);
  display: flex; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--line-soft); border-left: 3px solid var(--accent);
  border-radius: 16px; padding: 15px 18px; text-decoration: none; color: var(--text);
  transition: transform .18s, background .18s, box-shadow .18s;
}
.aff-banner:hover { transform: translateY(-3px); background: var(--panel-2); box-shadow: 0 18px 40px -26px rgba(0, 0, 0, .7); }
.aff-ic {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); background: rgba(148, 163, 184, .1);
}
.aff-ic .ic { width: 22px; height: 22px; }
.aff-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.aff-top { display: flex; align-items: center; gap: 8px; }
.aff-cat { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.aff-badge { font-size: 10px; font-weight: 700; color: var(--accent); border: 1px solid currentColor; border-radius: 999px; padding: 1px 7px; }
.aff-title { font-size: 15px; font-weight: 700; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aff-desc { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aff-go { color: var(--faint); font-size: 18px; flex-shrink: 0; transition: transform .18s, color .18s; }
.aff-banner:hover .aff-go { color: var(--accent); transform: translateX(3px); }
[dir="rtl"] .aff-banner:hover .aff-go { transform: translateX(-3px); }

/* ===== 신뢰 문구 (가짜 평점 대체) ===== */
.maker { padding: 16px 0 56px; }
.maker-note {
  max-width: 640px; margin: 0 auto; text-align: center;
  color: var(--muted); font-size: 15px; line-height: 1.85;
  background: linear-gradient(180deg, rgba(21, 31, 51, .5), rgba(17, 24, 39, .5));
  border: 1px solid var(--line-soft); border-radius: 18px; padding: 26px 30px;
}

/* ===== 미리보기 (썸네일 클릭 + 실시간 추정) ===== */
.file-thumb.clickable { cursor: zoom-in; }
.file-thumb.clickable:hover { outline: 2px solid var(--blue); outline-offset: 1px; }
.quality-est { color: var(--blue); font-size: 12px; font-weight: 700; min-width: 62px; }

/* 변환 진행바 */
.convert-progress { width: 100%; height: 4px; background: var(--line-soft); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.convert-progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, #0ea5e9, #6366f1, #a855f7); transition: width .2s ease; }

/* ===== 모달 ===== */
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 6, 15, .8); backdrop-filter: blur(4px); }
.modal-panel {
  position: relative; z-index: 1; width: min(760px, 100%); max-height: 90vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); padding: 18px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-close { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: 7px; cursor: pointer; display: inline-flex; }
.modal-close:hover { color: var(--text); border-color: var(--blue); }
.modal-close .ic { width: 18px; height: 18px; }
.modal-compare { border-radius: 14px; overflow: hidden; background: repeating-conic-gradient(#1e293b 0% 25%, #0f172a 0% 50%) 0 0 / 22px 22px; }
.modal-single { display: block; width: 100%; max-height: 62vh; object-fit: contain; }
.modal-meta { color: var(--muted); font-size: 13px; text-align: center; margin: 12px 0; word-break: keep-all; }
.modal-actions { display: flex; justify-content: center; }

/* ===== 변환 전/후 비교 슬라이더 ===== */
.cmp { position: relative; width: 100%; height: min(62vh, 460px); overflow: hidden; user-select: none; touch-action: none; }
.cmp-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.cmp-before { position: absolute; inset: 0; clip-path: inset(0 50% 0 0); }
.cmp-label { position: absolute; top: 10px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(3, 6, 15, .65); color: #fff; letter-spacing: .03em; }
.cmp-label-before { left: 10px; }
.cmp-label-after { right: 10px; }
.cmp-divider { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: #fff; margin-left: -1px; cursor: ew-resize; }
.cmp-divider:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.cmp-handle {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #0b1220;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .45);
}
@media (max-width: 560px) { .modal { padding: 12px; } .modal-panel { padding: 14px; } }

/* ===== 크롭(자르기) ===== */
.file-crop {
  background: none; border: 1px solid var(--line-soft); color: var(--muted);
  cursor: pointer; padding: 6px; flex-shrink: 0; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; transition: .15s;
}
.file-crop .ic-x { width: 16px; height: 16px; }
.file-crop:hover { color: var(--text); border-color: var(--blue); }
.file-crop.active { color: var(--blue); border-color: var(--blue); background: rgba(56, 189, 248, .12); }
.modal-actions-2 { gap: 10px; margin-top: 14px; }
.crop-area { border-radius: 14px; overflow: hidden; background: repeating-conic-gradient(#1e293b 0% 25%, #0f172a 0% 50%) 0 0 / 22px 22px; }
.crop { position: relative; width: 100%; height: min(58vh, 420px); overflow: hidden; touch-action: none; user-select: none; }
.crop-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.crop-box { position: absolute; border: 2px solid #fff; box-sizing: border-box; cursor: move; }
.crop-handle { position: absolute; width: 14px; height: 14px; background: #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.crop-handle[data-h="nw"] { left: -8px; top: -8px; cursor: nwse-resize; }
.crop-handle[data-h="ne"] { right: -8px; top: -8px; cursor: nesw-resize; }
.crop-handle[data-h="sw"] { left: -8px; bottom: -8px; cursor: nesw-resize; }
.crop-handle[data-h="se"] { right: -8px; bottom: -8px; cursor: nwse-resize; }
