/* fff.kr — 한 장짜리 CSS. 가독성 먼저(본문 17px·줄 1.7·대비 4.5↑), 누르는 곳 44px, 320px 넘침 없음, 밝은/어두운 모드,
   흐림·무한 움직임 없음. 글꼴은 기기 글꼴(받을 것 0 — 모든 언어 글자를 기기가 가장 잘 그린다). */
:root {
  color-scheme: light dark;
  --bg: light-dark(#ffffff, #0f1115);
  --bg2: light-dark(#f5f6f8, #171a21);
  --card: light-dark(#ffffff, #1b1f27);
  --ink: light-dark(#14161a, #eef0f3);
  --dim: light-dark(#575d66, #a7adb7);
  --line: light-dark(#e3e6ea, #2b303a);
  --accent: light-dark(#1f5eff, #6f9bff);
  --accent-ink: light-dark(#ffffff, #0b1020);
  --ok: light-dark(#0b7a4b, #4ccf8f);
  --bad: light-dark(#b42318, #ff8a80);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Noto Sans", "Hiragino Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.7 var(--font); word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; inset-inline-start: -9999px; }
.skip:focus { inset-inline-start: 12px; top: 12px; z-index: 9; background: var(--card); padding: 8px 12px; border-radius: 8px; }

/* 머리 */
.top { border-bottom: 1px solid var(--line); background: var(--bg); }
.top-in { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.logo { display: inline-flex; align-items: baseline; gap: 8px; color: var(--ink); text-decoration: none; min-height: 44px; align-items: center; }
.logo b { font-size: 1.45rem; font-weight: 900; letter-spacing: -.02em; }
.logo span { font-size: .8rem; color: var(--dim); font-weight: 600; }
.logo.big b { font-size: 2.6rem; }
.top-nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.top-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; white-space: nowrap; }
.top-nav a:hover { background: var(--bg2); }
.lang { position: relative; }
.lang summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; }
.lang summary::-webkit-details-marker { display: none; }
.lang ul { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 5; margin: 0; padding: 6px; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 12px; min-width: 180px; max-height: 70vh; overflow: auto; box-shadow: 0 8px 24px rgb(0 0 0 / .12); }
.lang a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.lang a:hover, .lang a[aria-current] { background: var(--bg2); font-weight: 700; }
@media (max-width: 520px) { .logo span, .lang summary span { display: none; } }

/* 머리말 */
.hero { padding-top: 36px; padding-bottom: 8px; }
.crumb { margin: 0 0 6px; font-size: .9rem; color: var(--dim); }
.crumb a { color: var(--dim); }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.7rem); line-height: 1.2; letter-spacing: -.025em; margin: 0 0 12px; font-weight: 850; }
.lead { font-size: 1.12rem; color: var(--dim); margin: 0 0 10px; max-width: 46em; }
.trust { display: inline-block; margin: 6px 0 0; padding: 8px 14px; border-radius: 999px; background: var(--bg2); font-size: .95rem; font-weight: 600; }

/* 도구 */
.tool { padding-top: 20px; padding-bottom: 12px; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 230px; padding: 28px 20px; text-align: center;
  border: 2px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: var(--radius); background: var(--bg2); cursor: pointer; transition: background .15s, border-color .15s; }
.drop:hover, .drop.on { background: color-mix(in srgb, var(--accent) 8%, var(--bg2)); border-color: var(--accent); }
.drop-icon { font-size: 2rem; line-height: 1; color: var(--accent); }
.drop-main { font-size: 1.2rem; font-weight: 800; }
.drop-sub { color: var(--dim); font-size: .95rem; margin-bottom: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); border-color: var(--accent); }
.btn[disabled] { opacity: .5; cursor: default; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 16px 0 0; }
.opt { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95rem; }
.opt span { display: flex; justify-content: space-between; }
.opt output { color: var(--accent); font-variant-numeric: tabular-nums; }
select, input[type=range], input[type=number] { width: 100%; min-height: 48px; font: inherit; }
input[type=number] { padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); }
.opt.chk { flex-direction: row; align-items: center; gap: 10px; min-height: 48px; align-self: end; cursor: pointer; }
.opt.chk input { width: 24px; height: 24px; accent-color: var(--accent); }
.related { padding-bottom: 40px; }
.related h2 { font-size: 1.3rem; margin: 0 0 12px; }
select { padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); }
input[type=range] { accent-color: var(--accent); }
.hint { margin: 10px 0 0; color: var(--dim); font-size: .95rem; }
.results { margin-top: 20px; }
.sum { font-weight: 700; margin: 0 0 10px; font-variant-numeric: tabular-nums; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.item img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: var(--bg2); }
.item .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { color: var(--dim); font-size: .92rem; font-variant-numeric: tabular-nums; }
.item .meta b { color: var(--ok); }
.item .meta b.up { color: var(--bad); }
.item .err { color: var(--bad); font-size: .92rem; }
.item .btn { min-height: 44px; padding: 0 14px; }
.bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; width: 40%; background: var(--accent); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .bar i { animation: none; width: 100%; opacity: .5; } }
.acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.warn { color: var(--bad); font-weight: 700; }
@media (max-width: 520px) { .item { grid-template-columns: 52px 1fr; } .item img { width: 52px; height: 52px; } .item .btn { grid-column: 1 / -1; } }

/* 설명 글 */
.doc { padding-top: 24px; padding-bottom: 40px; max-width: 760px; }
.doc h2 { font-size: 1.4rem; letter-spacing: -.015em; margin: 36px 0 12px; line-height: 1.35; }
.doc p { margin: 0 0 14px; }
.steps { margin: 0; padding-inline-start: 1.4em; }
.steps li { margin: 0 0 8px; }
.faq { display: grid; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.faq summary { cursor: pointer; padding: 12px 16px; min-height: 48px; font-weight: 700; display: flex; align-items: center; }
.faq details p { margin: 0; padding: 0 16px 14px; color: var(--dim); }

/* 대문 */
.cats { padding-top: 16px; }
.cats h2 { font-size: 1.3rem; margin: 18px 0 12px; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; gap: 4px; min-height: 120px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); text-decoration: none; }
.card:hover { border-color: var(--accent); }
.card-i { font-size: 1.6rem; }
.card span:last-child { color: var(--dim); font-size: .95rem; }
.root { padding-top: 12vh; text-align: center; }
.langs { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.langs a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 18px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 700; }

/* 바닥 */
.foot { border-top: 1px solid var(--line); background: var(--bg2); padding: 22px 0 32px; color: var(--dim); font-size: .92rem; }
.foot-promise { margin: 0 0 8px; font-weight: 600; }
.foot-nav { display: flex; gap: 6px 16px; flex-wrap: wrap; }
.foot-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--dim); }

/* PDF 도구: 파일 줄의 PDF 표시·순서 단추·결과 */
.item .ord { display: flex; gap: 6px; }
.btn.icon { min-width: 44px; min-height: 44px; padding: 0; font-size: 1.05rem; }
.pdf-ico { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 8px; background: color-mix(in srgb, #d93025 12%, var(--bg2)); color: light-dark(#b3261e, #ff8a80); font-weight: 900; font-size: .9rem; }
#results .opts { margin: 14px 0 0; }
input[type=text] { width: 100%; min-height: 48px; padding: 0 12px; font: inherit; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); }
input[type=text]:disabled { opacity: .5; }
#out { margin-top: 14px; }
#out .done { font-weight: 700; margin: 0 0 10px; }
#out .err { color: var(--bad); font-weight: 700; }
#out .working { color: var(--dim); }
@media (max-width: 520px) { .item .ord { grid-column: 1 / -1; justify-content: flex-end; } .pdf-ico { width: 52px; height: 52px; } }

/* 자르기 화면 */
.cropbox { margin-top: 16px; text-align: center; }
.cropbox canvas { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 10px; touch-action: none; cursor: crosshair; background: var(--bg2); }
.crop-size { margin: 8px 0 0; color: var(--dim); font-variant-numeric: tabular-nums; }
.cropbox .acts { justify-content: center; }

/* 광고 칸(설명 글 사이) · 안내 쪽 */
.ad { margin: 8px auto 24px; max-width: 760px; min-height: 120px; }
.ad-l { display: block; font-size: .78rem; color: var(--dim); margin-bottom: 4px; }
.page .updated { color: var(--dim); font-size: .92rem; }
.credits { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 8px 0 12px; }
.credits th, .credits td { text-align: start; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.credits a { word-break: break-all; }
.ijg { font-size: .85rem; color: var(--dim); }
@media (max-width: 520px) { .credits td:nth-child(2), .credits th:nth-child(2) { display: none; } }

/* ── 디자인 2판(11-28 대표 「디자인을 지금보다 더 개선」) — 가독성은 그대로, 묶음 색·신뢰 표시·카드·번호 단계·바닥 도구 목록 ── */
:root {
  --c-image: light-dark(#1f5eff, #7aa2ff);
  --c-image-bg: light-dark(#eaf0ff, #1b2440);
  --c-pdf: light-dark(#d93025, #ff8a80);
  --c-pdf-bg: light-dark(#fdecea, #3a1f1f);
  --shadow: 0 1px 2px rgb(16 24 40 / .06), 0 1px 3px rgb(16 24 40 / .08);
  --shadow-lg: 0 8px 24px rgb(16 24 40 / .10);
}
.cat-image { --c: var(--c-image); --c-bg: var(--c-image-bg); }
.cat-pdf { --c: var(--c-pdf); --c-bg: var(--c-pdf-bg); }

/* 머리: 로고 표시 */
.logo .mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-style: normal; font-weight: 900; font-size: 1rem; margin-inline-end: 2px; }
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); }

/* 대문 머리 띠 */
.hero-home { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--bg)) 0%, var(--bg) 100%); padding: 56px 0 28px; text-align: center; }
.hero-home h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.1rem); max-width: 18em; margin-inline: auto; }
.hero-home .lead { margin-inline: auto; }
.badges { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 16px 0 0; }
.hero-home .badges { justify-content: center; }
.badges li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: .92rem; box-shadow: var(--shadow); }
.badges .ck { color: var(--ok); font-weight: 900; }

/* 묶음 제목 · 카드 */
.cat-h { display: flex; align-items: center; gap: 10px; font-size: 1.35rem; margin: 28px 0 14px; }
.cat-h .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.cat-h small { color: var(--dim); font-weight: 600; font-size: .9rem; }
.grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card { flex-direction: row; align-items: center; gap: 14px; min-height: 92px; padding: 16px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s, transform .15s; }
.card:hover { border-color: var(--c, var(--accent)); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.card .ico, .tool-h .ico { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--c-bg, var(--bg2)); font-size: 1.5rem; }
.card-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-t b { font-size: 1.02rem; }
.card-t span { color: var(--dim); font-size: .92rem; line-height: 1.45; }
@media (prefers-reduced-motion: reduce) { .card, .card:hover { transition: none; transform: none; } }

/* 도구 쪽 머리 */
.tool-h { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.tool-h h1 { margin: 0; }
.tool-h .ico { width: 56px; height: 56px; border-radius: 14px; font-size: 1.8rem; }
.drop { min-height: 250px; background: color-mix(in srgb, var(--accent) 4%, var(--bg2)); box-shadow: inset 0 0 0 1px transparent; }
.drop-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); margin-bottom: 6px; }
.trust-note { margin: 10px 0 0; color: var(--dim); font-size: .92rem; text-align: center; }

/* 쓰는 법: 번호 카드 */
.steps { list-style: none; counter-reset: st; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.steps li { counter-increment: st; position: relative; margin: 0; padding: 44px 16px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.steps li::before { content: counter(st); position: absolute; top: 12px; inset-inline-start: 16px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 900; font-size: .9rem; }
.doc { max-width: 860px; }
.doc h2 { padding-top: 6px; }
.faq summary { justify-content: space-between; gap: 12px; }
.faq summary::after { content: '+'; color: var(--dim); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary { list-style: none; }

/* 바닥: 도구 전체 목록 */
.foot-dir { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 24px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.foot-h { margin: 0 0 4px; font-weight: 800; color: var(--ink); }
.foot-dir ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 16px; }
.foot-dir a { display: inline-flex; align-items: center; min-height: 36px; color: var(--dim); text-decoration: none; }
.foot-dir a:hover { color: var(--ink); text-decoration: underline; }
@media (pointer: coarse) { .foot-dir a { min-height: 44px; } }

/* 안내 글 */
.guide h1 { margin-top: 4px; }
.guide .lead { font-size: 1.15rem; }
.tips { margin: 0 0 14px; padding-inline-start: 1.3em; }
.tips li { margin: 0 0 8px; }
.guide-grid .card { min-height: 76px; }
.cat-h a { color: inherit; text-decoration: none; }
.guide table { width: 100%; border-collapse: collapse; margin: 6px 0 16px; font-size: .95rem; }
.guide th, .guide td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: start; vertical-align: top; }

/* 결과 줄 단추 · 전후 비교 */
.row-acts { display: flex; gap: 8px; }
.btn.ghost { background: transparent; }
@media (max-width: 520px) { .row-acts { grid-column: 1 / -1; } .row-acts .btn { flex: 1; } }
.cmp { border: 0; padding: 16px; border-radius: 16px; background: var(--card); color: var(--ink); max-width: min(96vw, 1100px); width: 100%; }
.cmp::backdrop { background: rgb(0 0 0 / .6); }
.cmp-box { position: relative; display: grid; }
.cmp-box img { grid-area: 1 / 1; width: 100%; max-height: 72vh; object-fit: contain; background: repeating-conic-gradient(#ccc 0 25%, #fff 0 50%) 0 0 / 20px 20px; border-radius: 8px; }
.cmp-clip { grid-area: 1 / 1; }
.cmp-l { position: absolute; top: 8px; padding: 2px 8px; border-radius: 6px; background: rgb(0 0 0 / .65); color: #fff; font-size: .85rem; font-weight: 700; }
.cmp-l1 { inset-inline-start: 8px; } .cmp-l2 { inset-inline-end: 8px; }
.cmp-r { width: 100%; margin: 12px 0; }
.cmp-x { width: 100%; }

/* PDF 쪽 순서 바꾸기 */
.pages { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.pg { border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 8px; text-align: center; cursor: grab; box-shadow: var(--shadow); }
.pg.drag { opacity: .4; }
.pg.off { opacity: .45; }
.pg.off .pg-img { filter: grayscale(1); }
.pg-img { aspect-ratio: 3 / 4; display: grid; place-items: center; background: var(--bg2); border-radius: 6px; overflow: hidden; }
.pg-img img { max-width: 100%; max-height: 100%; display: block; }
.pg-n { font-weight: 800; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.pg-b { display: flex; justify-content: center; gap: 4px; }
.pg-b .btn.icon { min-width: 36px; min-height: 36px; }
@media (pointer: coarse) { .pg-b .btn.icon { min-width: 44px; min-height: 44px; } }
.pg-help { grid-column: 1 / -1; color: var(--dim); font-weight: 600; }
/* 사진 속 글자 추출 */
.ocr-item { grid-template-columns: 96px 1fr; align-items: start; }
.ocr-item img { width: 96px; height: auto; max-height: 160px; object-fit: contain; }
.ocr-box { display: grid; gap: 8px; min-width: 0; }
.ocr-name { margin: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ocr-st { margin: 0; }
.ocr-text { width: 100%; padding: 10px 12px; font: 1rem/1.6 var(--font); border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); resize: vertical; }
.ocr-box .btn { justify-self: start; }
.ocr-box .bar i { width: 0; animation: none; opacity: 1; transition: width .2s; }
@media (max-width: 520px) { .ocr-item { grid-template-columns: 1fr; } .ocr-item img { width: 100%; max-height: 220px; } }
