/* YN 다운로더 — 정제된 미니멀 디자인 시스템
   중립 회색 기반 + 단일 그린 액센트 · lucide 라인 아이콘 · 얇은 border · 절제된 모션 */
:root {
  --accent: #10a548;
  --accent-strong: #0b8b3b;
  --accent-soft: #e9f7ee;
  --ink: #0f1419;
  --ink-2: #3d454e;
  --ink-soft: #6b7480;
  --ink-faint: #99a1ab;
  --line: #e7e9ec;
  --line-2: #eef0f2;
  --bg: #ffffff;
  --surface: #f7f8f9;
  --surface-2: #fbfcfc;
  --card: #ffffff;
  --danger: #e0483d;
  --shadow-sm: 0 1px 2px rgba(16, 22, 30, 0.04);
  --shadow-md: 0 8px 24px rgba(16, 22, 30, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="dark"] {
  --accent: #2bd06a;
  --accent-strong: #22b258;
  --accent-soft: #14271b;
  --ink: #e9edf1;
  --ink-2: #c2c8cf;
  --ink-soft: #939ba5;
  --ink-faint: #6a727c;
  --line: #262b33;
  --line-2: #20242b;
  --bg: #0e1013;
  --surface: #161a1f;
  --surface-2: #14171c;
  --card: #171b21;
  --danger: #ff6a5e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

/* ---------- 접근성 (a11y) ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 200; background: var(--accent); color: #fff;
  padding: 9px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; transition: top 0.15s var(--ease);
}
.skip-link:focus { top: 12px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: "Pretendard", "Inter", "Malgun Gothic", "Apple SD Gothic Neo",
    "Segoe UI", "Yu Gothic UI", "Meiryo", "Microsoft YaHei",
    "Nirmala UI", "Leelawadee UI", "Noto Sans", -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.container { max-width: 940px; margin: 0 auto; padding: 0 24px; }
h2 { font-size: 24px; font-weight: 700; text-align: center; letter-spacing: -0.02em; }
.section-sub { text-align: center; color: var(--ink-soft); font-size: 14.5px; margin: 10px auto 0; max-width: 620px; }

/* ---------- 아이콘 ---------- */
.ic { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; display: inline-block; }
.ic use { pointer-events: none; }

/* ---------- 헤더 ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 14px; height: 60px; }
.logo { font-size: 17px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; margin-right: auto; }
.logo-img { width: 28px; height: 28px; border-radius: 8px; display: block; }
.logo-yn {
  font-weight: 800; font-size: 19px; letter-spacing: -0.03em;
  background: linear-gradient(135deg, #00a129 0%, #84cc16 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.logo-word { font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.nav { display: flex; gap: 2px; }
.nav-link {
  padding: 7px 12px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
  color: var(--ink-soft); transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.nav-link:hover { color: var(--ink); background: var(--surface); }
.nav-link.active { color: var(--ink); font-weight: 600; }
.tab-link.active { color: var(--accent); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 1px solid var(--line); background: transparent;
  border-radius: var(--radius-sm); color: var(--ink-soft); cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-faint); }
.lang-select {
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: transparent;
  padding: 6px 8px; font-size: 13px; font-family: inherit; color: var(--ink-2);
  cursor: pointer; max-width: 150px; transition: border-color 0.15s var(--ease);
}
.lang-select:hover { border-color: var(--ink-faint); }

/* ---------- 히어로 ---------- */
.hero { padding: 60px 0 40px; text-align: center; }
/* 정직한 신뢰 문구 (가짜 평점 대체) */
.hero-trust {
  display: inline-block; font-size: 12.5px; color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 5px 14px; margin-bottom: 20px;
}
.hero h1 {
  font-size: 34px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.15;
  margin-bottom: 12px;
}
.hero-sub { color: var(--ink-soft); font-size: 16px; max-width: 560px; margin: 0 auto 28px; }

/* 메인 폼 */
.main-form {
  display: flex; gap: 8px; max-width: 620px; margin: 0 auto; align-items: stretch;
}
.input-wrap {
  flex: 1; display: flex; align-items: center; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease); min-width: 0;
}
.input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#url-input {
  flex: 1; border: 0; outline: 0; padding: 14px 16px; font-size: 15px;
  background: transparent; color: var(--ink); min-width: 0; direction: ltr; text-align: left;
}
#url-input::placeholder { color: var(--ink-faint); }
#clear-btn {
  border: 0; background: none; color: var(--ink-faint); font-size: 18px;
  padding: 0 6px; cursor: pointer; line-height: 1;
}
#clear-btn:hover { color: var(--ink-2); }
#paste-btn {
  border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 13.5px;
  padding: 0 14px; cursor: pointer; white-space: nowrap;
}
.btn-submit {
  display: inline-flex; align-items: center; gap: 7px; background: var(--accent); color: #fff;
  border: 0; border-radius: var(--radius); font-size: 15px; font-weight: 600;
  padding: 0 22px; cursor: pointer; transition: background 0.15s var(--ease); white-space: nowrap;
}
.btn-submit:hover { background: var(--accent-strong); }
.btn-submit:disabled { opacity: 0.55; cursor: wait; }
.btn-submit .ic { width: 17px; height: 17px; }

.terms-note { font-size: 12.5px; color: var(--ink-faint); margin-top: 16px; }
.terms-note a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
.terms-note a:hover { color: var(--accent); }

/* 서브탭 */
.sub-tabs { display: flex; justify-content: center; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.sub-tab {
  border: 1px solid var(--line); border-radius: 20px; background: var(--card);
  padding: 5px 14px; font-size: 12.5px; font-weight: 500; color: var(--ink-soft);
  cursor: pointer; transition: all 0.15s var(--ease);
}
.sub-tab:hover { border-color: var(--ink-faint); color: var(--ink-2); }
.sub-tab.active { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; }
:root[data-theme="dark"] .sub-tab.active { background: var(--accent); border-color: var(--accent); color: #06120a; }

/* ---------- 진행/에러 ---------- */
.indicator {
  max-width: 620px; margin: 24px auto 0; padding: 16px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 14.5px; color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.spinner {
  display: inline-block; width: 16px; height: 16px; flex-shrink: 0;
  border: 2px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result-box.simple.error {
  max-width: 620px; margin: 24px auto 0; padding: 15px 18px;
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--danger);
  border-radius: var(--radius); color: var(--ink-2); font-size: 14px; text-align: left;
  display: flex; align-items: center; gap: 12px;
}
.err-icon { width: 20px; height: 20px; color: var(--danger); flex-shrink: 0; }
#error-text { flex: 1; }
.retry-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  background: transparent; color: var(--ink-2); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; padding: 6px 12px; cursor: pointer; white-space: nowrap;
  transition: all 0.15s var(--ease);
}
.retry-btn:hover { border-color: var(--accent); color: var(--accent); }
.retry-btn .ic { width: 15px; height: 15px; }

/* ---------- 결과 박스 ---------- */
.result-box.video {
  max-width: 620px; margin: 24px auto 0; text-align: left; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
}
.thumb-box { width: 100%; }
.thumb-box .clip {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; overflow: hidden;
}
.thumb-box .thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.play-btn {
  position: absolute; inset: 0; margin: auto; width: 54px; height: 54px;
  background: rgba(15, 20, 25, 0.55); backdrop-filter: blur(2px); border-radius: 50%;
  color: #fff; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s var(--ease); font-size: 0;
}
.play-btn::before {
  content: ""; width: 0; height: 0; border-style: solid;
  border-width: 9px 0 9px 15px; border-color: transparent transparent transparent #fff; margin-left: 3px;
}
.thumb-box .clip:hover .play-btn { background: var(--accent); }
.duration {
  position: absolute; right: 10px; bottom: 10px; background: rgba(15, 20, 25, 0.82);
  color: #fff; font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 5px;
}
.duration:empty { display: none; }

.info-box { padding: 20px 22px 22px; }
.meta .row.title {
  font-size: 16px; font-weight: 700; line-height: 1.4; letter-spacing: -0.02em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.meta .row.sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge-platform, .badge-extra {
  font-size: 11px; font-weight: 600; border-radius: 5px; padding: 2px 8px; letter-spacing: 0.01em;
}
.badge-platform { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }
.badge-extra { background: var(--accent-soft); color: var(--accent-strong); }

.playlist-note {
  margin: 14px 0 0; font-size: 12.5px; color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px;
}
.filename-input {
  width: 100%; margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 13.5px; font-family: inherit; color: var(--ink);
  background: var(--surface-2); transition: border-color 0.15s var(--ease);
}
.filename-input:focus { outline: none; border-color: var(--accent); background: var(--card); }

/* 다운로드 버튼 + 드롭다운 */
.link-box { margin-top: 14px; display: flex; align-items: stretch; position: relative; }
.def-btn-box { flex: 1; }
.main-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  background: var(--accent); color: #fff; font-size: 14.5px; font-weight: 600;
  height: 44px; border-radius: var(--radius) 0 0 var(--radius);
  transition: background 0.15s var(--ease);
}
.main-btn::before {
  content: ""; width: 17px; height: 17px; flex-shrink: 0;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M5 21h14'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M5 21h14'/%3E%3C/svg%3E") center/contain no-repeat;
  background: #fff;
}
.main-btn:hover { background: var(--accent-strong); }
.main-btn.busy { opacity: 0.7; cursor: wait; }

.drop-down-box { display: flex; }
.def-btn-name {
  display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; cursor: pointer;
  color: #fff; font-size: 13.5px; font-weight: 600; background: var(--accent-strong);
  border: 0; border-left: 1px solid rgba(255,255,255,0.22);
  border-radius: 0 var(--radius) var(--radius) 0; white-space: nowrap;
  transition: background 0.15s var(--ease);
}
.def-btn-name:hover { filter: brightness(1.06); }
.def-btn-name .chevron { width: 15px; height: 15px; transition: transform 0.2s var(--ease); }
.link-box.expand .def-btn-name .chevron { transform: rotate(180deg); }

.list {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; min-width: 260px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 8px; animation: menuIn 0.14s var(--ease);
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.fmt-group-label {
  display: flex; align-items: center; gap: 6px; padding: 8px 8px 4px;
  font-size: 11px; font-weight: 600; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.04em;
}
.fmt-group-label .ic { width: 14px; height: 14px; }
.fmt-item {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 9px 10px; font-size: 13.5px; font-weight: 500; cursor: pointer; border-radius: var(--radius-sm);
  color: var(--ink-2); transition: background 0.12s var(--ease);
}
.fmt-item:hover { background: var(--surface); }
.fmt-item.selected { color: var(--accent); font-weight: 600; }
.fmt-item .fmt-size { color: var(--ink-faint); font-size: 12px; font-weight: 500; }
.links .hidden { overflow: hidden; max-height: 0; transition: max-height 0.25s var(--ease); }
.links .hidden.showall { max-height: 600px; }
.more-links { padding: 2px 0; }
.more-links a {
  display: flex; align-items: center; gap: 5px; padding: 8px 10px; font-size: 12.5px;
  color: var(--ink-soft); border-radius: var(--radius-sm);
}
.more-links a:hover { background: var(--surface); color: var(--ink); }
.actions { margin-top: 4px; border-top: 1px solid var(--line-2); padding-top: 4px; }
.actions .fmt-item.copy-link { color: var(--ink-soft); justify-content: flex-start; gap: 8px; }
.actions .fmt-item.copy-link .ic { width: 15px; height: 15px; }
.fmt-item .ic { width: 15px; height: 15px; }

.def-file-info {
  display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; color: var(--ink-faint);
}
.sel-reason { color: var(--accent); font-weight: 600; }
.sel-reason:not(:empty)::after { content: "·"; color: var(--ink-faint); margin-left: 8px; }

.second-btn-box { margin-top: 12px; }
.second-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px; cursor: pointer;
  color: var(--ink-2); font-size: 13.5px; font-weight: 600; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); transition: all 0.15s var(--ease);
}
.second-btn:hover { border-color: var(--accent); color: var(--accent); }
.second-btn.busy { opacity: 0.7; cursor: wait; }
.second-btn .ic { width: 16px; height: 16px; }

/* 진행바 */
.dl-progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.dl-track { flex: 1; height: 6px; background: var(--surface); border-radius: 4px; overflow: hidden; }
:root[data-theme="dark"] .dl-track { background: #2a2f37; }
.dl-bar { height: 100%; width: 0%; background: var(--accent); border-radius: 4px; transition: width 0.35s var(--ease); }
.dl-bar.indeterminate { width: 40% !important; animation: indet 1.1s var(--ease) infinite; }
@keyframes indet { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }
.dl-pct { font-size: 12.5px; font-weight: 700; color: var(--accent); min-width: 40px; text-align: right; }
.dl-cancel {
  display: inline-flex; align-items: center; border: 1px solid var(--line); background: transparent;
  color: var(--ink-soft); border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  padding: 5px 11px; cursor: pointer; transition: all 0.15s var(--ease);
}
.dl-cancel:hover { border-color: var(--danger); color: var(--danger); }

/* 추가 액션 */
.extra-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.xa-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  background: transparent; color: var(--ink-soft); border-radius: 20px; font-size: 12.5px;
  font-weight: 500; padding: 6px 13px; cursor: pointer; transition: all 0.15s var(--ease);
}
.xa-btn:hover { border-color: var(--ink-faint); color: var(--ink); }
.xa-btn .ic { width: 15px; height: 15px; }

/* ---------- 여러 링크 일괄 다운로드 ---------- */
.batch-sec {
  max-width: 620px; margin: 24px auto 0; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px 18px;
  box-shadow: var(--shadow-sm); text-align: left; animation: popIn 0.2s var(--ease);
}
.batch-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.batch-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.batch-actions { display: flex; align-items: center; gap: 6px; }
.batch-all {
  display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: #fff;
  border: 0; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; padding: 7px 14px; cursor: pointer;
  transition: background 0.15s var(--ease);
}
.batch-all:hover { background: var(--accent-strong); }
.batch-all .ic { width: 15px; height: 15px; }
.batch-close {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border: 1px solid var(--line); background: transparent; color: var(--ink-soft); border-radius: var(--radius-sm); cursor: pointer;
}
.batch-close:hover { color: var(--ink); border-color: var(--ink-faint); }
.batch-close .ic { width: 15px; height: 15px; }
.batch-note { font-size: 12px; color: var(--ink-faint); margin: 6px 0 12px; }
.batch-list { display: flex; flex-direction: column; gap: 8px; }
.batch-row {
  display: flex; align-items: center; gap: 11px; padding: 9px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface-2);
}
.batch-thumb {
  width: 64px; height: 40px; flex-shrink: 0; border-radius: 6px; overflow: hidden; background: var(--surface);
  display: flex; align-items: center; justify-content: center; color: var(--ink-faint);
}
.batch-thumb img { width: 100%; height: 100%; object-fit: cover; }
.batch-thumb .ic { width: 18px; height: 18px; }
.batch-body { flex: 1; min-width: 0; }
.batch-rt { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batch-status { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }
.batch-status .ic { width: 13px; height: 13px; }
.batch-status.done { color: var(--accent); }
.batch-status.fail { color: var(--danger); }
.batch-act { flex-shrink: 0; }
.batch-dl {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink-2); border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; padding: 6px 11px; cursor: pointer;
  transition: all 0.15s var(--ease);
}
.batch-dl:hover { border-color: var(--accent); color: var(--accent); }
.batch-dl.retry:hover { border-color: var(--danger); color: var(--danger); }
.batch-dl .ic { width: 14px; height: 14px; }

/* ---------- 미리보기 모달 ---------- */
.player-modal {
  position: fixed; inset: 0; z-index: 100; background: rgba(10, 13, 17, 0.8);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: fadeIn 0.15s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.player-inner { position: relative; width: min(880px, 100%); }
.player-inner video { width: 100%; max-height: 82vh; background: #000; border-radius: var(--radius); display: block; }
.player-close {
  position: absolute; top: -42px; right: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; background: rgba(255,255,255,0.12); border: 0; color: #fff;
  border-radius: var(--radius-sm); font-size: 22px; cursor: pointer; line-height: 1;
}
.player-close:hover { background: rgba(255,255,255,0.22); }

/* ---------- 최근 다운로드 ---------- */
.history { padding: 44px 0 8px; }
.hist-head { display: flex; align-items: center; justify-content: center; gap: 14px; }
.hist-head h2 { font-size: 20px; }
.hist-clear {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: transparent;
  border-radius: var(--radius-sm); font-size: 12.5px; color: var(--ink-soft); padding: 5px 11px; cursor: pointer;
  transition: all 0.15s var(--ease);
}
.hist-clear:hover { border-color: var(--danger); color: var(--danger); }
.history .section-sub { margin-top: 6px; margin-bottom: 18px; font-size: 12.5px; }
.hist-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.hist-card {
  display: flex; gap: 11px; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; background: var(--card); align-items: center; transition: border-color 0.15s var(--ease);
}
.hist-card:hover { border-color: var(--ink-faint); }
.hist-card img { width: 80px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; background: var(--surface); flex-shrink: 0; }
.hist-body { min-width: 0; flex: 1; }
.hist-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-meta { font-size: 11.5px; color: var(--ink-faint); margin: 2px 0 7px; }
.hist-btn {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); color: var(--ink-2);
  background: transparent; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  padding: 4px 10px; cursor: pointer; transition: all 0.15s var(--ease);
}
.hist-btn:hover { border-color: var(--accent); color: var(--accent); }
.hist-btn .ic { width: 14px; height: 14px; }

/* ---------- 지원 사이트 ---------- */
.supported { padding: 50px 0 40px; }
.site-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 24px; }
.site-chip {
  border: 1px solid var(--line); border-radius: 20px; padding: 6px 15px; font-size: 13px;
  color: var(--ink-soft); background: var(--card); transition: all 0.15s var(--ease);
}
.site-chip.main-chip { font-weight: 600; color: var(--ink-2); }
.site-chip.active-chip { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- 변환기 ---------- */
.converter { padding: 50px 0; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.convert-box { max-width: 600px; margin: 26px auto 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.convert-drop {
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 30px 16px; text-align: center;
  cursor: pointer; transition: all 0.15s var(--ease);
}
.convert-drop:hover, .convert-drop.dragover { border-color: var(--accent); background: var(--accent-soft); }
.convert-drop .drop-ic { width: 30px; height: 30px; color: var(--ink-faint); margin-bottom: 8px; }
.convert-drop:hover .drop-ic, .convert-drop.dragover .drop-ic { color: var(--accent); }
#convert-drop-text { font-size: 14.5px; color: var(--ink-2); }
.convert-drop b { color: var(--accent); font-weight: 600; }
.convert-hint { font-size: 12px; color: var(--ink-faint); margin-top: 6px; }
.convert-controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.convert-controls label { font-size: 13.5px; color: var(--ink-soft); display: flex; align-items: center; gap: 9px; }
.convert-controls select {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 11px;
  font-size: 13.5px; font-family: inherit; color: var(--ink); background: var(--card); cursor: pointer;
}
.btn-green {
  background: var(--accent); color: #fff; border: 0; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; padding: 10px 24px; cursor: pointer; transition: background 0.15s var(--ease);
}
.btn-green:hover { background: var(--accent-strong); }
.btn-green:disabled { opacity: 0.45; cursor: not-allowed; }
.convert-status { margin-top: 16px; font-size: 13.5px; color: var(--ink-soft); }
.convert-status .cv-row { display: flex; align-items: center; gap: 9px; }
.convert-status .cv-track { height: 5px; background: var(--surface); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.convert-status .cv-bar { height: 100%; width: 40%; background: var(--accent); border-radius: 3px; }
.convert-status .cv-bar.indeterminate { animation: indet 1.1s var(--ease) infinite; }
.convert-status.ok { color: var(--accent-strong); }
.convert-status.fail { color: var(--danger); }
.convert-status .ic { width: 16px; height: 16px; }
.convert-presets { display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: center; margin-top: 20px; }
.convert-presets a { font-size: 13px; color: var(--ink-soft); }
.convert-presets a:hover { color: var(--accent); }

/* ---------- 가이드/장점 ---------- */
.howto { padding: 56px 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 30px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.step-num {
  display: inline-flex; width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: var(--bg);
  font-weight: 700; font-size: 14px; align-items: center; justify-content: center; margin-bottom: 12px;
}
:root[data-theme="dark"] .step-num { background: var(--accent); color: #06120a; }
.step h3 { font-size: 15.5px; font-weight: 700; margin-bottom: 7px; letter-spacing: -0.01em; }
.step p { font-size: 13.5px; color: var(--ink-soft); }
kbd { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: 11.5px; font-family: inherit; }

.features { padding: 56px 0; background: var(--surface); border-top: 1px solid var(--line); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 30px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feat-ic {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); margin-bottom: 14px;
}
.feat-ic .ic { width: 19px; height: 19px; }
.feature h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.01em; }
.feature p { font-size: 13px; color: var(--ink-soft); }

/* ---------- FAQ ---------- */
.faq { padding: 56px 0; }
.faq h2 { margin-bottom: 28px; }
.faq details {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 4px 18px; margin: 0 auto 8px; max-width: 720px; transition: border-color 0.15s var(--ease);
}
.faq details[open] { border-color: var(--ink-faint); }
.faq summary {
  font-weight: 600; font-size: 14.5px; cursor: pointer; list-style: none; position: relative;
  padding: 14px 28px 14px 0; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 2px; top: 50%; width: 15px; height: 15px; margin-top: -7px;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
  background: var(--ink-soft); transition: transform 0.2s var(--ease);
}
.faq details[open] summary::after { transform: rotate(180deg); }
.faq details p { padding: 0 0 16px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.7; }

/* ---------- 이용 안내/푸터 ---------- */
.notice { padding: 44px 0; background: var(--surface); border-top: 1px solid var(--line); }
.notice h2 { font-size: 18px; margin-bottom: 12px; }
.notice p { max-width: 720px; margin: 0 auto; font-size: 13px; color: var(--ink-soft); text-align: center; line-height: 1.75; }

.footer { border-top: 1px solid var(--line); padding: 44px 0 36px; }
.footer-cols { display: grid; grid-template-columns: 1fr 1fr 1fr 1.5fr; gap: 28px; }
.footer-col h4 { font-size: 12.5px; font-weight: 700; margin-bottom: 12px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { font-size: 13px; color: var(--ink-soft); }
.footer-col a:hover { color: var(--accent); }
.footer-brand .logo { margin-bottom: 12px; }
.footer-brand p { font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; }
.footer-note { font-size: 12px; color: var(--ink-faint); margin-top: 8px; line-height: 1.6; }
.footer-note a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
.footer-note a:hover { color: var(--accent); }
.footer-brand .copyright { font-size: 12px; color: var(--ink-faint); margin-top: 14px; }

/* ---------- 법률 페이지 (개인정보·약관) ---------- */
.legal { padding: 44px 0 64px; }
.legal .container { max-width: 760px; }
.legal h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.legal-date { font-size: 12.5px; color: var(--ink-faint); margin-top: 8px; }
.legal-intro { font-size: 14.5px; color: var(--ink-soft); margin: 20px 0 8px; line-height: 1.75; }
.legal h2 { font-size: 16px; font-weight: 700; text-align: left; margin: 28px 0 8px; letter-spacing: -0.01em; }
.legal p { font-size: 14px; color: var(--ink-2); line-height: 1.8; }
.legal ul { margin: 4px 0 0; padding-left: 18px; }
.legal li { font-size: 14px; color: var(--ink-2); line-height: 1.8; margin-bottom: 4px; }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.legal strong { color: var(--ink); font-weight: 700; }
.legal-foot { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13.5px; }

/* ---------- 토스트 ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(0);
  background: var(--ink); color: var(--bg); font-size: 13.5px; font-weight: 500; padding: 11px 20px;
  border-radius: var(--radius); z-index: 200; box-shadow: var(--shadow-md); max-width: 90vw;
  animation: toastIn 0.2s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--accent); color: #fff; }

/* ---------- 광고 슬롯 ---------- */
.ad-wrap { max-width: 940px; margin: 0 auto; padding: 0 24px; }
.ad-slot {
  margin: 28px auto; text-align: center; min-height: 100px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
/* 결과/다운로드 버튼과 충분히 이격 (실수 클릭 방지, AdSense 정책) */
.ad-after-result { margin-top: 44px; }
.ad-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 6px; align-self: center;
}
.ad-slot .adsbygoogle { width: 100%; }
.ad-placeholder {
  width: 100%; max-width: 728px; min-height: 90px; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line); border-radius: var(--radius); color: var(--ink-faint);
  font-size: 12px; letter-spacing: 0.1em; background: var(--surface-2);
}

/* ---------- 제휴 혜택 대시보드 ---------- */
.partner { padding: 52px 0; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.partner h2 { font-size: 22px; }
.partner-disc {
  text-align: center; font-size: 12px; color: var(--ink-faint); margin: 8px auto 26px; max-width: 640px; line-height: 1.6;
}
.partner-filter { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 22px; }
.pf-tab {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  border-radius: 20px; padding: 5px 13px; font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: all 0.15s var(--ease);
}
.pf-tab:hover { border-color: var(--ink-faint); color: var(--ink-2); }
.pf-tab.active { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; }
:root[data-theme="dark"] .pf-tab.active { background: var(--accent); border-color: var(--accent); color: #06120a; }
.partner-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.deal-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 15px 13px;
  background: var(--card); overflow: hidden;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.deal-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand);
}
.deal-card:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow-md); }
.deal-head { display: flex; align-items: center; gap: 10px; }
.deal-ic {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: 9px; background: var(--brand); color: #fff; flex-shrink: 0;
}
.deal-card.brand-light .deal-ic { color: #1a1a1a; }
.deal-ic .ic { width: 19px; height: 19px; }
.deal-names { min-width: 0; }
.deal-brand { font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal-cat { font-size: 11px; color: var(--ink-faint); margin-top: 1px; }
.deal-desc { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; flex: 1; }
.deal-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.deal-go {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--brand);
}
.deal-card.brand-light .deal-go { color: var(--ink); }
.deal-go .ic { width: 14px; height: 14px; transition: transform 0.15s var(--ease); }
.deal-card:hover .deal-go .ic { transform: translateX(3px); }
.deal-ad { font-size: 9.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.partner-more {
  grid-column: 1 / -1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  margin: 4px auto 0; padding: 11px 22px; border: 1px solid var(--line); border-radius: 22px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); background: var(--card);
  transition: all 0.15s var(--ease); width: fit-content;
}
.partner-more:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.partner-more .ic { width: 15px; height: 15px; }

/* ---------- RTL ---------- */
[dir="rtl"] .header-inner, [dir="rtl"] .nav { direction: rtl; }
[dir="rtl"] .logo { margin-right: 0; margin-left: auto; }
[dir="rtl"] .main-btn { border-radius: 0 var(--radius) var(--radius) 0; }
[dir="rtl"] .def-btn-name { border-radius: var(--radius) 0 0 var(--radius); border-left: 0; border-right: 1px solid rgba(255,255,255,0.22); }
[dir="rtl"] .list { right: auto; left: 0; }
[dir="rtl"] .sel-reason:not(:empty)::after { margin-left: 0; margin-right: 8px; }
[dir="rtl"] .faq summary { padding: 14px 0 14px 28px; }
[dir="rtl"] .faq summary::after { right: auto; left: 2px; }
[dir="rtl"] .result-box.simple.error { border-left: 1px solid var(--line); border-right: 3px solid var(--danger); }
#url-input { direction: ltr; text-align: left; }

/* ---------- 반응형 ---------- */
@media (max-width: 760px) {
  .container { padding: 0 18px; }
  .nav-link:not(.tab-link) { display: none; }
  .hero { padding: 40px 0 32px; }
  .hero h1 { font-size: 27px; }
  .hero-sub { font-size: 15px; }
  .main-form { flex-direction: column; }
  .btn-submit { justify-content: center; padding: 13px; }
  .list { right: 0; left: 0; min-width: 0; }
  .steps, .feature-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 22px; }
  .hist-list { grid-template-columns: 1fr; }
  .partner-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 761px) and (max-width: 1024px) {
  .partner-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 420px) {
  .partner-grid { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .footer-cols { grid-template-columns: 1fr; }
  .lang-select { max-width: 118px; }
}
