:root {
  --bg: #f6f5fb;
  --card: #ffffff;
  --ink: #17162b;
  --muted: #6b6a80;
  --line: #e6e4f0;
  --accent: #6a4cff;
  --accent-2: #ff4f9a;
  --accent-ink: #ffffff;
  --soft: #f0edff;
  --ok: #10a36f;
  --warn: #c77700;
  --bad: #d33c4a;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 16, 60, .05), 0 8px 24px rgba(20, 16, 60, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0e18; --card: #191826; --ink: #ecebf7; --muted: #9b99b3; --line: #2b2a3d;
    --soft: #231f3d; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, "Malgun Gothic", system-ui, sans-serif;
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.err { color: var(--bad); min-height: 1.2em; margin: 6px 0; font-size: 14px; white-space: pre-line; }

/* 머리글 */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--ink); text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.logo-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #fff;
  font-size: 13px; letter-spacing: -.5px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.top-nav { display: flex; align-items: center; gap: 10px; min-width: 0; }
.me { font-weight: 600; }
.yt-chip { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--soft); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.yt-chip a { text-decoration: none; font-weight: 600; }

/* 버튼 */
.btn { appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 10px 18px; border-radius: 12px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: transform .05s, box-shadow .15s; white-space: nowrap; }
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.primary { background: linear-gradient(135deg, var(--accent), #8a5cff); color: var(--accent-ink); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn.danger { color: var(--bad); }
.link { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; padding: 0; text-decoration: underline; }

/* 첫 화면 */
.landing { padding: 48px 0 64px; }
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-block; font-weight: 700; color: var(--accent); background: var(--soft); padding: 4px 12px; border-radius: 999px; font-size: 13px; }
.hero h1 { font-size: clamp(28px, 4.4vw, 44px); line-height: 1.22; letter-spacing: -1px; margin: 14px 0; }
.hero h1 em { font-style: normal; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 17px; color: var(--muted); }
.steps3 { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 18px 0; }
.steps3 li { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 6px; font-weight: 600; }
.steps3 b { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; margin-right: 6px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.auth label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0; }
input, textarea, select { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; margin-top: 6px; }
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: auto; margin: 0; accent-color: var(--accent); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border-radius: 12px; padding: 4px; }
.tab { border: 0; background: none; font: inherit; font-weight: 700; padding: 8px; border-radius: 9px; color: var(--muted); cursor: pointer; }
.tab.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

/* 작업 화면 */
.app { padding: 24px 16px 80px; display: grid; gap: 18px; }
.step h2 { margin: 0 0 14px; font-size: 19px; display: flex; align-items: center; gap: 10px; }
.num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--soft); color: var(--accent); font-size: 14px; }
.notice { padding: 12px 16px; border-radius: 12px; background: var(--soft); font-weight: 600; }
.notice.bad { background: color-mix(in srgb, var(--bad) 14%, var(--card)); color: var(--bad); }

.drop { border: 2px dashed var(--line); border-radius: 14px; padding: 28px 16px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop.over, .drop:hover { border-color: var(--accent); background: var(--soft); }
.drop-icon { font-size: 28px; width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 8px; border-radius: 50%; background: var(--soft); color: var(--accent); }
.drop p { margin: 4px 0; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 4px; font-size: 14px; }
.consent input { margin-top: 4px; }
.upbar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.upbar .bar { flex: 1; }
.bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s; }

.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 14px; }
.vcard { position: relative; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--bg); }
.vcard.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.vcard img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: center 22%; background: #000; }
.vcard .vmeta { padding: 8px 10px; font-size: 12.5px; }
.vcard .vname { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.vcard .vdel { position: absolute; top: 6px; right: 6px; border: 0; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; }
.scan-ok { color: var(--ok); } .scan-warn { color: var(--warn); }

.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; font: inherit; font-weight: 700; padding: 8px 16px; border-radius: 9px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.animal-mode { display: grid; gap: 8px; margin: 14px 0 0; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 14px; }
.radio input { margin-top: 4px; }
.radio:has(input:checked) { border-color: var(--accent); background: var(--soft); }
.radio em { font-style: normal; color: var(--warn); font-weight: 600; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 12px; margin-top: 16px; }
.face { border: 2px solid transparent; border-radius: 14px; background: var(--bg); padding: 0; cursor: pointer; overflow: hidden; text-align: left; font: inherit; color: var(--ink); }
.face img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.face.animal img { object-fit: contain; background: radial-gradient(circle at 50% 40%, var(--soft), var(--bg)); padding: 6px; }
.face span { display: block; padding: 6px 10px 8px; font-weight: 700; font-size: 14px; }
.face small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.face.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

.row { display: flex; align-items: center; flex-wrap: wrap; }
.row.gap { gap: 10px; }
.spacer { flex: 1; }
.summary { margin: 14px 0; padding: 12px 14px; background: var(--bg); border-radius: 12px; font-size: 14px; }

.jobs { display: grid; gap: 10px; }
.job { display: grid; grid-template-columns: 112px 1fr auto; gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 14px; }
.job-thumb { position: relative; }
.job-thumb img { width: 112px; height: 72px; object-fit: cover; object-position: center 22%; border-radius: 10px; background: var(--bg); display: block; }
.badge { position: absolute; left: 6px; top: 6px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; }
.job-title { font-weight: 700; }
.job-sub { font-size: 13px; }
.job .bar { margin: 6px 0 4px; }
.job-msg { font-size: 13px; }
.job-msg.bad { color: var(--bad); white-space: pre-line; }
.job-msg.ok { color: var(--ok); font-weight: 600; }
.job-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* 대화상자 */
.dlg { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 24px)); background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.dlg::backdrop { background: rgba(10, 8, 30, .55); }
.wide-dlg { width: min(1000px, calc(100vw - 24px)); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); margin: 0; }
.dlg-head h3 { margin: 0; font-size: 17px; }
.x { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px 20px; }
.compare figure { margin: 0; }
.compare figcaption { font-weight: 700; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.compare video, .compare img { width: 100%; max-height: 62vh; background: #000; border-radius: 12px; display: block; object-fit: contain; }
.dlg-foot { padding: 0 20px 18px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 8px 0; }
.ytform { padding: 8px 20px 4px; }
.ytform label { display: block; font-weight: 600; font-size: 14px; margin: 10px 0; }
.ytform .row label { flex: 1; }
.ytform .check { font-weight: 500; }
.channel { background: var(--soft); padding: 8px 12px; border-radius: 10px; font-weight: 600; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .landing { padding-top: 24px; }
  .job { grid-template-columns: 84px 1fr; }
  .job-thumb img { width: 84px; height: 60px; }
  .job-act { grid-column: 1 / -1; justify-content: flex-start; }
  .compare { grid-template-columns: 1fr; }
  .me { display: none; }
  .yt-chip { max-width: 130px; }
  .logo { font-size: 16px; gap: 8px; }
  .top-nav { gap: 6px; }
}
