/*!
 * PDF의 모든 것 (all-about-pdf) — 디자인 시스템
 * 외부 요청 0: 폰트도 로컬 동봉(에이투지체 + 시스템 폴백).
 */

/* ── 에이투지체(A2Z) 로컬 동봉 — 외부 요청 0. 무료 폰트, 원저작자 라이선스 별도 ── */
@font-face { font-family: 'AtoZ'; font-weight: 400; font-style: normal; font-display: swap; src: url(../vendor/fonts/a2z-Regular.woff2) format('woff2'); }
@font-face { font-family: 'AtoZ'; font-weight: 500; font-style: normal; font-display: swap; src: url(../vendor/fonts/a2z-Medium.woff2) format('woff2'); }
@font-face { font-family: 'AtoZ'; font-weight: 600; font-style: normal; font-display: swap; src: url(../vendor/fonts/a2z-SemiBold.woff2) format('woff2'); }
@font-face { font-family: 'AtoZ'; font-weight: 700; font-style: normal; font-display: swap; src: url(../vendor/fonts/a2z-Bold.woff2) format('woff2'); }
@font-face { font-family: 'AtoZ'; font-weight: 800; font-style: normal; font-display: swap; src: url(../vendor/fonts/a2z-ExtraBold.woff2) format('woff2'); }
@font-face { font-family: 'AtoZ'; font-weight: 900; font-style: normal; font-display: swap; src: url(../vendor/fonts/a2z-Black.woff2) format('woff2'); }

/* ── 토큰 ───────────────────────────────────────────── */
:root {
  color-scheme: light dark;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #fafbfe;
  --ink: #181d27;
  --ink-soft: #5b6573;
  --ink-faint: #6b7280; /* WCAG AA(≈4.6:1) — 동작 안내 힌트 가독성 */
  --line: #e7ebf2;
  --line-strong: #d4dae5;
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --accent-soft: #eef0fe;
  --accent-ink: #3730a3;
  --success: #15a05a;
  --success-soft: #e7f7ee;
  --danger: #e5484d;
  --warn: #b7791f;
  --warn-soft: #fdf6e7;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(20, 30, 60, .06), 0 1px 3px rgba(20, 30, 60, .04);
  --shadow: 0 6px 24px rgba(25, 35, 70, .08);
  --shadow-lg: 0 16px 48px rgba(25, 35, 70, .12);
  --font: 'AtoZ', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo',
    'Noto Sans KR', 'Malgun Gothic', 'Segoe UI', Roboto, sans-serif;
  --maxw: 1080px;
  --readw: 760px;
}

/* ── 리셋 ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
/* scrollbar-gutter: 페이지마다 스크롤바 유무가 달라 콘텐츠가 좌우로 툭 밀리던 문제 방지
   (스크롤바 없는 페이지에도 그만큼의 공간을 항상 예약 → 페이지 이동 시 흔들림 없음) */
html { background: var(--surface); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  line-height: 1.78; font-size: 16px; letter-spacing: -.005em;
  word-break: keep-all; line-break: strict;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
p { line-height: 1.82; }

/* 커스텀 아이콘 (이모지 대체) */
.ic-svg { width: 24px; height: 24px; display: block; }
.callout__ic { display: inline-flex; }
.callout__ic .ic-svg { width: 20px; height: 20px; }
.related a .ic { display: inline-flex; color: var(--accent); }
.related a .ic .ic-svg { width: 22px; height: 22px; }
img, svg { max-width: 100%; display: block; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.3; letter-spacing: -.02em; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; }

/* ── 레이아웃 ────────────────────────────────────────── */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.container--read { max-width: var(--readw); }
.section { padding: 56px 0; }
.section--tight { padding: 36px 0; }
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--accent); color: #fff;
  padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ── 헤더 ───────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.12rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand__logo { width: 30px; height: 30px; display: inline-flex; flex-shrink: 0; }
.brand__logo svg { width: 100%; height: 100%; display: block; }
.brand__dot { color: var(--accent); }
.site-nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink-soft); font-size: .9rem; font-weight: 600; padding: 7px 11px;
  border-radius: 8px;
}
.site-nav a:hover { background: var(--accent-soft); color: var(--accent-ink); text-decoration: none; }

/* ── 버튼 ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: inherit; font-weight: 700; font-size: .96rem; line-height: 1;
  padding: 12px 20px; border-radius: 12px; border: 1px solid transparent;
  cursor: pointer; transition: transform .06s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(79, 70, 229, .28); }
.btn--primary:hover { background: var(--accent-strong); text-decoration: none; }
.btn--primary:disabled { background: var(--line-strong); color: #fff; box-shadow: none; cursor: not-allowed; }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface-2); text-decoration: none; }
.btn--lg { padding: 15px 28px; font-size: 1.05rem; border-radius: 14px; }
.btn--sm { padding: 8px 14px; font-size: .86rem; }
.btn--block { width: 100%; }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 홈: 히어로 ─────────────────────────────────────── */
.hero { padding: 60px 0 34px; text-align: center; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 700;
  color: var(--accent-ink); background: var(--accent-soft); padding: 6px 13px; border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 { margin-bottom: 14px; }
.hero__sub { font-size: clamp(1rem, 2.4vw, 1.18rem); color: var(--ink-soft); max-width: 620px; margin: 0 auto 26px; }
.hero__usp { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }

/* ── 신뢰 배지 ──────────────────────────────────────── */
.badges { display: flex; flex-wrap: wrap; gap: 10px; }
.badges--center { justify-content: center; }
.badge {
  display: inline-flex; align-items: center; gap: 7px; font-size: .86rem; font-weight: 600;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  padding: 9px 14px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.badge__ic { color: var(--success); font-weight: 800; }

/* ── 도구 그리드(홈) ────────────────────────────────── */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tool-card {
  display: flex; flex-direction: column; gap: 8px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px;
  box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent); text-decoration: none; }
.tool-card__ic {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); font-size: 1.4rem; margin-bottom: 4px;
}
.tool-card__title { font-weight: 800; font-size: 1.08rem; color: var(--ink); }
.tool-card__desc { font-size: .9rem; color: var(--ink-soft); line-height: 1.55; }
.tool-card__go { margin-top: auto; font-size: .86rem; font-weight: 700; color: var(--accent-strong); }

/* ── 도구 페이지 헤더 ───────────────────────────────── */
.breadcrumb { font-size: .82rem; color: var(--ink-faint); padding: 18px 0 4px; }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb span { margin: 0 6px; }
.tool-hero { text-align: center; padding: 14px 0 26px; }
.tool-hero h1 { margin-bottom: 8px; }
.tool-hero__sub { color: var(--ink-soft); font-size: 1.05rem; margin-bottom: 18px; }

/* ── 도구 위젯 ──────────────────────────────────────── */
.tool {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow); max-width: 720px; margin: 0 auto;
}
.dropzone {
  border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2);
  padding: 40px 24px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
  outline: none;
}
.dropzone:hover, .dropzone:focus-visible { border-color: #c4cad7; background: #f0f2f7; }
.dropzone--over { border-color: #b4bbcb; background: var(--accent-soft); }
.dropzone__icon { width: 52px; height: 52px; margin: 0 auto 12px; color: var(--accent); }
.dropzone__title { font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }
.dropzone__hint { font-size: .85rem; color: var(--ink-soft); margin: 0; }
.dropzone__hint .link { color: var(--accent-strong); font-weight: 700; text-decoration: underline; }
.dropzone__btn { display: inline-block; margin: 4px 0 12px; background: var(--accent); color: #fff; font-weight: 700; font-size: .92rem; padding: 10px 22px; border-radius: 999px; transition: background .15s, transform .1s; }
.dropzone:hover .dropzone__btn { background: var(--accent-strong); }

.pagecount { text-align: center; font-size: .85rem; color: var(--ink-faint); margin: 10px 0 0; }

.filelist { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.filelist__item {
  display: flex; align-items: center; gap: 10px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px;
}
.filelist__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.filelist__name { font-size: .92rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filelist__size { font-size: .78rem; color: var(--ink-faint); }
.filelist__ctrls { display: flex; gap: 4px; flex-shrink: 0; }
.iconbtn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-soft); cursor: pointer; font-size: .9rem;
  display: grid; place-items: center; transition: background .12s, color .12s, border-color .12s;
}
.iconbtn:hover { background: var(--accent-soft); color: var(--accent-ink); border-color: #cdd2de; }
.iconbtn--danger:hover { background: #fdecec; color: var(--danger); border-color: #ecd2d2; }

/* ── 옵션 ───────────────────────────────────────────── */
.options { margin-top: 18px; display: flex; flex-direction: column; gap: 16px; }
.option { display: flex; flex-direction: column; gap: 8px; }
.option__label { font-size: .9rem; font-weight: 700; color: var(--ink); }
.option__hint { font-size: .8rem; color: var(--ink-faint); font-weight: 500; }
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 8px;
  font-size: .88rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; transition: all .12s;
}
.segmented input:checked + span { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent-strong); outline-offset: 1px; }
.field {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 10px;
  font-family: inherit; font-size: .95rem; background: var(--surface); color: var(--ink);
}
.field:focus { outline: none; border-color: #bcc2d0; box-shadow: 0 0 0 3px rgba(79, 70, 229, .11); }
select.field { cursor: pointer; }
.checkbox { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: .92rem; font-weight: 600; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--accent); }
.option-row { display: flex; flex-wrap: wrap; gap: 16px; }
.option-row .option { flex: 1; min-width: 160px; }

.actions { margin-top: 22px; }
.progress {
  margin-top: 16px; height: 30px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; position: relative; overflow: hidden;
}
.progress__bar { height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }
.progress__text { position: absolute; inset: 0; display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: var(--ink); }
.result { margin-top: 18px; padding: 16px; background: var(--success-soft); border: 1px solid #bfe8cf; border-radius: var(--radius-sm); }
.result__ok { margin: 0 0 10px; font-size: .95rem; color: #0f6c3d; }
.result__preview { margin-top: 12px; }
.result__preview-cap { display: block; font-size: .78rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.result__preview-strip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.result__preview-strip img { height: 92px; width: auto; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); box-shadow: 0 1px 3px rgba(23,23,42,.08); }
.result__preview-more { font-size: .82rem; font-weight: 700; color: var(--ink-soft); align-self: center; padding: 0 6px; }
.result__check { display: inline-block; vertical-align: middle; width: 20px; height: 20px; border-radius: 50%; background: var(--success); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.6l4.4 4.4L19.5 6.5'/%3E%3C/svg%3E"); background-size: 12px; background-position: center; background-repeat: no-repeat; }

/* ── 콘텐츠 본문 ────────────────────────────────────── */
.prose { color: var(--ink); }
.prose h2 { margin-top: 1.8em; }
.prose .lead { font-size: 1.06rem; color: var(--ink-soft); }
.steps { list-style: none; counter-reset: step; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.steps li {
  display: flex; gap: 13px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 16px; font-size: .96rem;
}
.steps li::before {
  counter-increment: step; content: counter(step); flex-shrink: 0;
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 800; font-size: .85rem; display: grid; place-items: center;
}
.callout {
  display: flex; gap: 12px; padding: 16px 18px; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid #d4e0ff; font-size: .94rem; color: var(--ink);
}
.callout--security { background: var(--success-soft); border-color: #bfe8cf; }
.callout--warn { background: var(--warn-soft); border-color: #f0dca8; }
.callout__ic { font-size: 1.2rem; flex-shrink: 0; }
.callout strong { display: block; margin-bottom: 2px; }

/* ── FAQ ────────────────────────────────────────────── */
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 16px 18px; font-weight: 700; font-size: .98rem; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--accent); font-size: 1.3rem; font-weight: 400; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq__a { padding: 0 18px 16px; color: var(--ink-soft); font-size: .94rem; }

/* ── 관련 도구 ──────────────────────────────────────── */
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.related a {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 13px 15px; font-weight: 700; font-size: .92rem; color: var(--ink);
  transition: border-color .12s, background .12s;
}
.related a:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.related a .ic { font-size: 1.15rem; }

/* ── 푸터 ───────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; padding: 40px 0 56px; }
.site-footer__grid { display: flex; flex-wrap: wrap; gap: 28px 56px; justify-content: space-between; }
.site-footer__col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); margin-bottom: 12px; }
.site-footer__col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer__col a { color: var(--ink-soft); font-size: .9rem; }
.site-footer__brand { max-width: 280px; }
.site-footer__brand p { font-size: .88rem; color: var(--ink-soft); margin-top: 10px; }
.site-footer__bottom { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--ink-faint); display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; }

/* ── 토스트 ─────────────────────────────────────────── */
.toast-wrap { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; min-width: 200px; max-width: 90vw; padding: 12px 18px; border-radius: 12px;
  background: #222a37; color: #fff; font-size: .9rem; font-weight: 600; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s;
}
.toast--show { opacity: 1; transform: translateY(0); }
.toast--error { background: var(--danger); }
.toast--info { background: #222a37; }
.toast--warn { background: #b45309; }
.toast--success { background: #0f7a45; }

/* 터치 기기: 파일 조작·페이지 편집 버튼을 오탭 없이 누를 수 있게 확대 */
@media (pointer: coarse) {
  .iconbtn { width: 40px; height: 40px; }
  .pcop { width: 34px; height: 34px; font-size: 15px; }
  .pagecell--org .pcops { gap: 6px; }
}

/* ── 유틸 ───────────────────────────────────────────── */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.muted { color: var(--ink-soft); }
.divider { height: 1px; background: var(--line); border: 0; margin: 40px 0; }

/* ── 반응형 ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .section { padding: 40px 0; }
  .tool { padding: 18px; border-radius: var(--radius); }
  .dropzone { padding: 30px 16px; }
  .site-nav a { padding: 6px 8px; font-size: .84rem; }
  .hero { padding: 40px 0 24px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ── 컴포넌트 디테일 & 부드러운 모션 ─────────────────── */
:root { --ease: cubic-bezier(.22, .61, .36, 1); }
.btn { transition: transform .12s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease), color .15s; }
.btn--primary:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(79, 70, 229, .26); }
.btn--primary:not(:disabled):active { transform: translateY(0); box-shadow: 0 3px 10px rgba(79, 70, 229, .22); }
.btn--ghost { transition: background .15s var(--ease), border-color .15s, transform .12s var(--ease); }
.btn--ghost:active { transform: translateY(0); }

.dropzone { transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease); }
.dropzone:hover { box-shadow: 0 6px 22px rgba(25, 35, 70, .05); }
.dropzone--over { box-shadow: 0 0 0 4px rgba(79, 70, 229, .08); }
.dropzone__icon { transition: transform .25s var(--ease); }
.dropzone:hover .dropzone__icon { transform: translateY(-3px); }
.dropzone__btn { transition: background .15s var(--ease), transform .12s var(--ease), box-shadow .15s var(--ease); box-shadow: 0 6px 16px rgba(79, 70, 229, .22); }
.dropzone:hover .dropzone__btn { transform: translateY(-1px); }

.field { transition: border-color .15s var(--ease), box-shadow .18s var(--ease), background .15s; }
.segmented span { transition: background .18s var(--ease), color .15s var(--ease), box-shadow .18s; }
.iconbtn { transition: background .14s var(--ease), color .14s, border-color .14s, transform .1s var(--ease); }
.iconbtn:active { transform: scale(.92); }
.checkbox input { transition: transform .1s var(--ease); }

.filelist__item { transition: background .15s var(--ease), border-color .15s; animation: aapItemIn .32s var(--ease) both; }
.filelist__item:hover { background: #eef1f6; }
@keyframes aapItemIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.progress__bar { transition: width .35s var(--ease); }
.result { animation: aapItemIn .34s var(--ease) both; }
.result__check { animation: aapPop .4s var(--ease) both; }
@keyframes aapPop { 0% { transform: scale(0); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }

.faq details { transition: border-color .15s var(--ease); }
.faq summary { transition: color .15s; }
.faq summary::after { transition: transform .25s var(--ease); }
.tool-card, .related a { transition: transform .14s var(--ease), box-shadow .18s var(--ease), border-color .15s; }
a { transition: color .14s var(--ease); }

/* ── design-dna 적용: 도구(세부) 페이지 디테일 ───────── */
.breadcrumb { padding: 24px 0 2px; font-weight: 600; }
.tool-hero { position: relative; padding: 12px 0 30px; }
.tool-hero::before { display: none; }
.tool-hero h1 { letter-spacing: -.033em; }
.tool-hero__sub { font-size: 1.08rem; line-height: 1.6; max-width: 540px; margin: 0 auto 20px; }
.badge { box-shadow: var(--shadow-sm); padding: 9px 15px; }
.badge__ic { display: inline-flex; color: var(--accent); }
.badge__ic .ic-svg { width: 15px; height: 15px; }
.tool { box-shadow: 0 26px 64px rgba(25, 35, 70, .10); border-radius: 24px; padding: 26px; }
.prose h2 { letter-spacing: -.025em; margin-bottom: .65em; }
.prose .lead { font-size: 1.1rem; line-height: 1.75; color: var(--ink-soft); }
.steps li { box-shadow: var(--shadow-sm); padding: 15px 18px; }
.steps li::before { box-shadow: 0 3px 8px rgba(79, 70, 229, .2); }
.callout { border-radius: 14px; align-items: flex-start; }
.related { gap: 12px; }
.related a { box-shadow: var(--shadow-sm); padding: 14px 16px; }
.related a:hover { transform: translateY(-2px); box-shadow: 0 11px 26px rgba(25, 35, 70, .1); border-color: var(--line-strong); }
.section--tight { padding: 32px 0; }

/* ── UX: 페이지 썸네일 선택 그리드 ───────────────────── */
.pagegrid { margin-top: 18px; }
.pagegrid__loading { text-align: center; color: var(--ink-soft); font-size: .9rem; padding: 18px 0; }
.pagegrid__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 10px; max-height: 360px; overflow-y: auto; padding: 2px; }
.pagecell { padding: 0; border: none; background: transparent; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 5px; font-family: inherit; }
.pagecell__img { position: relative; width: 100%; aspect-ratio: 3 / 4; display: grid; place-items: center; border-radius: 8px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow-sm); transition: box-shadow .15s var(--ease), transform .12s var(--ease); }
.pagecell__img img { display: block; width: 100%; height: 100%; object-fit: contain; }
.pagecell__img::after { content: ''; position: absolute; inset: 0; background: rgba(79, 70, 229, .16); opacity: 0; transition: opacity .15s; }
.pagecell:hover .pagecell__img { transform: translateY(-2px); box-shadow: var(--shadow); }
.pagecell__no { font-size: .8rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 24px; text-align: center; transition: color .15s; }
.pagecell.is-sel .pagecell__img { box-shadow: 0 0 0 2px var(--accent), var(--shadow-sm); }
.pagecell.is-sel .pagecell__img::after { opacity: 1; }
.pagecell.is-sel .pagecell__no { color: var(--accent); }
.pagecell.is-sel .pagecell__img::before { content: ''; position: absolute; top: 5px; right: 5px; z-index: 1; width: 19px; height: 19px; border-radius: 50%; background: var(--accent); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.6l4.4 4.4L19.5 6.5'/%3E%3C/svg%3E"); background-size: 12px; background-position: center; background-repeat: no-repeat; }
.pagegrid__hint { text-align: center; color: var(--ink-faint); font-size: .82rem; margin: 12px 0 0; }

/* ── UX: 파일 드래그 정렬 ────────────────────────────── */
.filelist__grip { display: inline-flex; align-items: center; color: var(--ink-faint); cursor: grab; flex-shrink: 0; padding: 0 2px; }
.filelist__item.is-draggable { cursor: grab; }
.filelist__item.is-draggable:active { cursor: grabbing; }
.filelist__item.dragging { opacity: .45; }
.filelist__item.drag-over { box-shadow: inset 0 3px 0 -1px var(--accent); }
.filelist__thumb { flex-shrink: 0; width: 30px; height: 40px; border-radius: 5px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.filelist__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
/* 이미지 변환 도구: 업로드한 사진 전체가 잘리지 않고 보이도록 정사각 박스 + contain */
.filelist__thumb--img { width: 46px; height: 46px; display: grid; place-items: center; background: var(--surface-2, #f1f3f7); }
.filelist__thumb--img img { width: 100%; height: 100%; object-fit: contain; object-position: center; }

/* 분할 모드: 구간 그룹 + 자르기 지점 */
.pagecell--split { position: relative; padding: 4px; border-radius: 10px; transition: background .15s var(--ease); }
.pagecell--split[data-seg="1"] { background: var(--accent-soft); }
.pagecell--split.is-cut::before { content: ''; position: absolute; left: -5px; top: 12%; bottom: 12%; width: 3px; border-radius: 2px; background: var(--accent); }
.pagecell--split.is-locked { cursor: default; }
.pagecell--split:not(.is-locked):hover .pagecell__img { box-shadow: 0 0 0 2px var(--accent), var(--shadow-sm); }

/* 정리 모드: 드래그 재정렬 + 페이지별 회전/삭제 */
.pagegrid__grid--org { grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 14px; max-height: 470px; }
.pagecell--org { position: relative; cursor: grab; gap: 6px; }
.pagecell--org:active { cursor: grabbing; }
.pagecell--org.dragging { opacity: .4; }
.pagecell--org.drag-over .pagecell__img { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.pagecell--org .pagecell__img { aspect-ratio: 3 / 4; display: grid; place-items: center; background: var(--surface); }
.pagecell--org .pagecell__img img { width: 100%; height: 100%; object-fit: contain; transition: transform .22s var(--ease); }
.pagecell--org .pagecell__img img[data-rot="90"]  { transform: rotate(90deg)  scale(.74); }
.pagecell--org .pagecell__img img[data-rot="180"] { transform: rotate(180deg); }
.pagecell--org .pagecell__img img[data-rot="270"] { transform: rotate(270deg) scale(.74); }
.pcops { position: absolute; top: 5px; left: 5px; right: 5px; z-index: 2; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; pointer-events: none; }
.pagecell--org:hover .pcops, .pagecell--org:focus-within .pcops { opacity: 1; pointer-events: auto; }
.pcop { width: 23px; height: 23px; border-radius: 6px; border: none; display: grid; place-items: center; font-size: 13px; line-height: 1; cursor: pointer; color: #fff; background: rgba(23, 23, 42, .72); box-shadow: var(--shadow-sm); transition: background .14s; }
.pcop:hover { background: rgba(23, 23, 42, .94); }
.pcop--del { margin-left: auto; background: rgba(229, 37, 42, .82); }
.pcop--del:hover { background: #e5252a; }
@media (hover: none) { .pagecell--org .pcops { opacity: 1; pointer-events: auto; } }

/* 번호 미리보기 */
.numprev { position: relative; width: 230px; max-width: 78%; margin: 4px auto 0; }
.numprev img { display: block; width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: var(--shadow); }
.numprev__badge { position: absolute; font-weight: 800; font-size: .82rem; color: var(--ink); background: rgba(255, 255, 255, .92); padding: 2px 7px; border-radius: 5px; box-shadow: var(--shadow-sm); }
.numprev__badge.pos-bottom-center { bottom: 7px; left: 50%; transform: translateX(-50%); }
.numprev__badge.pos-bottom-left { bottom: 7px; left: 7px; }
.numprev__badge.pos-bottom-right { bottom: 7px; right: 7px; }
.numprev__badge.pos-top-center { top: 7px; left: 50%; transform: translateX(-50%); }
.numprev__badge.pos-top-left { top: 7px; left: 7px; }
.numprev__badge.pos-top-right { top: 7px; right: 7px; }

/* ── 접근성: 키보드 포커스 가시성 (커서 숨김 대비) ───── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.btn:focus-visible, .pillbtn:focus-visible, .herotool__tab:focus-visible, .tchip:focus-visible, .pagecell:focus-visible, .dropzone:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── 모바일 헤더: 줄바꿈 대신 가로 스크롤 ──────────────── */
@media (max-width: 600px) {
  .site-header__inner { height: 56px; gap: 12px; }
  .brand { font-size: 1rem; }
  .site-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { padding: 6px 9px; white-space: nowrap; }
}

/* ===== 다크 모드 (prefers-color-scheme) — 위젯 기반 토큰 반전 ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1016;
    --surface: #171a21;
    --surface-2: #1e222b;
    --ink: #e9ebef;
    --ink-soft: #aeb4c0;
    --ink-faint: #8b93a1;
    --line: #2a2f3a;
    --line-strong: #3a4150;
    --accent: #7c78ff;
    --accent-strong: #948fff;
    --accent-soft: #23233a;
    --accent-ink: #b9b5ff;
    --success: #2fb872;
    --success-soft: #10241a;
    --danger: #ff6b6f;
    --warn: #e0a23c;
    --warn-soft: #2a2110;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 1px 3px rgba(0, 0, 0, .3);
    --shadow: 0 6px 24px rgba(0, 0, 0, .45);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, .55);
  }
  html { background: var(--surface); }
  /* callout 하드코딩 밝은 테두리 보정 */
  .callout { border-color: #33385a; }
  .callout--warn { border-color: #4a3a1e; }
  /* 결과 카드(기반 스타일) */
  .result { background: var(--success-soft); border-color: #1f4a33; }
  .result__ok { color: #7fdca8; }
  /* 성공 체크·프리뷰 썸네일 테두리 */
  .result__preview-strip img { border-color: var(--line-strong); }
}
