/* Voice Denoise 스타일 — 색 토큰과 첫 화면 구성은 Sign PDF(pdf-signer)와 같게 맞췄다.
   색상은 모두 토큰으로 정의하고 다크 모드에서 다시 지정한다. */
:root {
  color-scheme: light dark;
  --bg: #f5f6fa; --card: #ffffff; --foreground: #1a1a2e; --muted: #5b6075;
  --border: #d6d9e3; --border-strong: #b8bdcf;
  --accent: #3563e9; --accent-text: #2a55d6; --accent-soft: #3563e91f;
  --go: #15803d; --go-hover: #116c33; --ok: #15803d; --danger: #b91c1c;
  --danger-bg: #b91c1c12; --danger-border: #b91c1c45;
  --track: #e3e6ee;
  --wave-orig: #cfd3df; --wave-orig-active: #8a90a6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117; --card: #181b24; --foreground: #e6e8ef; --muted: #a0a6b8;
    --border: #2c3140; --border-strong: #3c4254;
    --accent-text: #8fb0ff; --accent-soft: #5b8cff29;
    --ok: #4ade80; --danger: #f87171;
    --danger-bg: #f8717114; --danger-border: #f8717150;
    --track: #2c3140;
    --wave-orig: #343a4b; --wave-orig-active: #7a8197;
  }
}
* { box-sizing: border-box; }
body { font-family: -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif; background: var(--bg); color: var(--foreground); margin: 0; line-height: 1.55; }
a { color: var(--accent-text); }
[hidden] { display: none !important; }
.wrap { max-width: 860px; margin: 0 auto; padding: 24px 20px 0; }

/* ---- 헤더·푸터 ---- */
.site-header { background: var(--card); border-bottom: 1px solid var(--border); }
.site-header .inner { max-width: 860px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 6px 20px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.2rem; color: var(--foreground); text-decoration: none; }
.brand svg { width: 30px; height: 30px; flex: none; }
.site-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.site-nav a { padding: 8px 14px; border-radius: 8px; font-size: 1rem; font-weight: 500; color: var(--foreground); text-decoration: none; }
.site-nav a:hover { background: var(--accent-soft); }
.site-nav a[aria-current="page"] { color: var(--accent-text); font-weight: 600; }
@media (max-width: 480px) {
  .site-nav a { padding: 6px 10px; font-size: 0.95rem; }
}
.site-footer { margin-top: 56px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.82rem; }
.site-footer .inner { max-width: 860px; margin: 0 auto; padding: 20px 20px 40px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; gap: 14px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--foreground); }

/* ---- 첫 화면(파일 선택 전) — 큰 제목, 한 문장, 큰 버튼 하나 ---- */
.hero { text-align: center; padding: 56px 16px 64px; border-radius: 18px; }
.hero h1 { font-size: 2.75rem; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 14px; }
.hero .sub { font-size: 1.15rem; line-height: 1.65; color: var(--muted); max-width: 640px; margin: 0 auto 32px; }
.hero .alt { margin: 18px 0 0; font-size: 0.95rem; color: var(--muted); }
.hero .formats { margin: 6px 0 0; font-size: 0.85rem; color: var(--muted); }
.hero .status { margin: 10px auto 0; max-width: 560px; font-size: 0.9rem; min-height: 1.4em; }
.hero .trust { display: inline-flex; align-items: center; gap: 7px; margin: 22px 0 0; padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); font-size: 0.85rem; color: var(--muted); }
.hero .trust svg { width: 15px; height: 15px; flex: none; }
.hero.over { outline: 3px dashed var(--accent); outline-offset: -10px; background: var(--accent-soft); }
/* 터치 화면에는 끌어다 놓기가 없다 */
@media (pointer: coarse) { .hero .alt { display: none; } }
@media (max-width: 600px) {
  .hero { padding: 36px 8px 44px; }
  .hero h1 { font-size: 2rem; }
  .hero .sub { font-size: 1.02rem; margin-bottom: 26px; }
}

/* ---- 버튼 ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 15px; font: inherit; font-size: 0.87rem; font-weight: 600; border-radius: 9px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--foreground); border-color: var(--border-strong); }
.btn.small { padding: 6px 12px; font-size: 0.82rem; }
.btn.huge { font-size: 1.5rem; padding: 20px 60px; border-radius: 14px; box-shadow: 0 12px 32px rgba(53, 99, 233, 0.35); }
.btn.huge:hover { background: #2a55d6; border-color: #2a55d6; }
.btn.big { font-size: 1.1rem; padding: 14px 28px; border-radius: 12px; }
.btn.green { background: var(--go); border-color: var(--go); }
.btn.green:hover { background: var(--go-hover); border-color: var(--go-hover); }
.btn.green span { font-weight: 400; opacity: 0.85; font-size: 0.9em; }
.btn:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 600px) {
  .btn.huge { width: 100%; max-width: 420px; font-size: 1.25rem; padding: 18px 24px; }
  .btn.big { width: 100%; }
  .fmt { width: 100%; }
  .fmt label { flex: 1; text-align: center; }
}

/* ---- 작업 화면(파일 선택 후) ---- */
.filebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 14px; }
.filebar .fileinfo { font-weight: 600; overflow-wrap: anywhere; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; }
.card h2 { font-size: 1.15rem; margin: 0 0 4px; }
/* ---- 처리 중 화면: 전체 진행률 하나 ---- */
.progress { text-align: center; padding: 34px 24px 26px; }
.progress-title { font-size: 1.35rem; margin: 0; }
.progress-pct { font-size: 3rem; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--accent-text); margin: 10px 0 18px; }
.pbar { position: relative; height: 14px; max-width: 560px; margin: 0 auto; border-radius: 999px; background: var(--track); overflow: hidden; }
.pbar-fill { position: relative; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #6b93ff); transition: width 0.25s ease-out; overflow: hidden; }
/* 진행 중임을 보여 주는 빛줄기 */
.pbar-fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent); transform: translateX(-100%); animation: shine 1.4s ease-in-out infinite; }
@keyframes shine { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .pbar-fill { transition: none; } .pbar-fill::after { animation: none; } }
.progress-eta { margin: 10px 0 0; min-height: 1.5em; font-size: 0.92rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.steps { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px; list-style: none; padding: 0; margin: 20px 0 0; font-size: 0.9rem; color: var(--muted); }
.steps li { display: inline-flex; align-items: center; gap: 7px; }
.steps .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; }
.steps li[data-state="active"] { color: var(--foreground); font-weight: 600; }
.steps li[data-state="active"] .dot { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 4px, transparent 5px); animation: pulse 1.2s ease-in-out infinite; }
.steps li[data-state="done"] .dot { border-color: var(--ok); background: var(--ok); }
.steps li[data-state="done"] .dot::after { content: "✓"; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px var(--accent-soft); } }
@media (prefers-reduced-motion: reduce) { .steps li[data-state="active"] .dot { animation: none; } }
.progress .btnrow { justify-content: center; margin-top: 18px; }
.progress .hint { margin-top: 12px; }
@media (max-width: 480px) {
  .progress { padding: 26px 16px 20px; }
  .progress-pct { font-size: 2.5rem; }
  .steps { gap: 6px 14px; font-size: 0.85rem; }
}
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.hint { font-size: 0.8rem; color: var(--muted); margin: 10px 0 0; }
.err { color: var(--danger); }
.errbox { margin: 0; padding: 14px 16px; border: 1px solid var(--danger-border); background: var(--danger-bg); color: var(--danger); border-radius: 12px; font-weight: 600; }

/* ---- 결과: 파형·재생·A/B·강도 ---- */
.result-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; margin-bottom: 14px; }
.result .note { margin: 0; color: var(--muted); font-size: 0.9rem; }
.wave { position: relative; height: 92px; border-radius: 10px; background: var(--bg); cursor: pointer; touch-action: none; }
.wave:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wave canvas { display: block; width: 100%; height: 100%; }
.legend { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 0.75rem; color: var(--muted); }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.legend .sw.orig { background: var(--wave-orig-active); }
.legend .sw.clean { background: var(--accent); margin-left: 8px; }

.transport { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.playbtn { flex: none; width: 48px; height: 48px; border-radius: 50%; border: none; background: var(--accent); color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(53, 99, 233, 0.3); }
.playbtn:hover { background: #2a55d6; }
.playbtn svg { width: 24px; height: 24px; }
.playbtn .i-pause, .playbtn.playing .i-play { display: none; }
.playbtn.playing .i-pause { display: block; }
.playbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.time { font-variant-numeric: tabular-nums; font-size: 0.95rem; color: var(--muted); min-width: 7.5em; }
.ab { margin-left: auto; display: inline-flex; padding: 3px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.ab button { border: none; background: transparent; color: var(--muted); font: inherit; font-size: 0.92rem; font-weight: 600; padding: 9px 16px; border-radius: 9px; cursor: pointer; }
.ab button[aria-pressed="true"] { background: var(--card); color: var(--foreground); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.ab #abClean[aria-pressed="true"] { color: var(--accent-text); }
.ab button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.strength { margin: 20px 0 0; padding: 16px 0 0; border: 0; border-top: 1px solid var(--border); min-width: 0; }
.strength legend { float: left; padding: 0; margin: 0 0 8px; font-weight: 700; font-size: 0.95rem; }
.seg { clear: both; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; background: var(--card); }
.seg label { position: relative; cursor: pointer; }
.seg label + label { border-left: 1px solid var(--border-strong); }
/* 화면에서는 숨기되 스크린 리더와 키보드에는 남긴다 */
.seg input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; clip-path: inset(50%); }
.seg span { display: block; padding: 10px 6px; text-align: center; font-size: 0.92rem; color: var(--muted); }
.seg input:checked + span { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.strength .hint { min-height: 1.5em; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; }
.btn.green b { font-weight: inherit; }
.fmt { display: inline-flex; margin: 0; padding: 3px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); min-width: 0; }
.fmt label { position: relative; cursor: pointer; }
.fmt input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; clip-path: inset(50%); }
.fmt span { display: block; padding: 11px 16px; border-radius: 9px; font-weight: 700; font-size: 0.95rem; color: var(--muted); }
.fmt input:checked + span { background: var(--card); color: var(--foreground); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.fmt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.btn.big.ghost { font-size: 1rem; }
.btn.busy { opacity: 0.6; cursor: progress; }
@media (max-width: 520px) {
  .strength .hint { min-height: 3.1em; } /* 설명이 1~2줄로 바뀌어도 아래 버튼이 움직이지 않게 */
  .ab { margin-left: 0; width: 100%; }
  .ab button { flex: 1; }
  .actions .btn { width: 100%; }
}

/* ---- 설명 글(도구 아래 안내·가이드·정책) ---- */
.content { margin-top: 48px; }
.prose { max-width: 760px; }
.prose h2 { font-size: 1.2rem; line-height: 1.4; margin: 32px 0 10px; }
.prose p, .prose li { font-size: 1rem; line-height: 1.8; }
.prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 4px; }
.faq details { border: 1px solid var(--border); border-radius: 10px; background: var(--card); padding: 10px 14px; }
.faq details + details { margin-top: 8px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 0; }
.prose h1 { font-size: 1.7rem; line-height: 1.35; margin: 0 0 10px; }
.prose h3 { font-size: 1.04rem; margin: 24px 0 6px; }
.prose ul { padding-left: 1.3em; }
.prose .meta { color: var(--muted); font-size: 0.85rem; margin: 0 0 18px; }
.prose .lead { font-size: 1.06rem; color: var(--muted); }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.92rem; margin: 12px 0; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--card); }
.table-scroll { overflow-x: auto; }
.prose .cta { margin: 36px 0 0; }
.prose .cta .btn { text-decoration: none; }
.cardlinks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; padding: 0 !important; margin: 12px 0 0; list-style: none; }
.cardlinks li + li { margin-top: 0; }
.cardlinks a { display: block; height: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--foreground); text-decoration: none; }
.cardlinks a:hover { border-color: var(--accent); }
.cardlinks b { display: block; margin-bottom: 4px; line-height: 1.45; }
.cardlinks span { display: block; font-size: 0.85rem; line-height: 1.6; color: var(--muted); }

/* ---- 광고 자리: assets/ads.js가 채운다. 설정 전에는 HTML의 hidden으로 숨겨져 있다 ---- */
.ad-slot { margin: 40px 0; min-height: 100px; }
/* 처리 중·결과 화면에서는 버튼(취소·내려받기)과 광고 사이를 더 띄운다 */
.workspace:not([hidden]) + .ad-slot { margin-top: 80px; }
.ad-slot .ad-label { display: block; font-size: 0.7rem; color: var(--muted); margin-bottom: 4px; }
/* ?adpreview=1 로 열었을 때 광고 자리를 점선 상자로 보여 준다(배치 확인용) */
.ad-slot.preview { display: grid; place-items: center; min-height: 120px; border: 2px dashed var(--border-strong); border-radius: 12px; color: var(--muted); font-size: 0.85rem; }
