/* style.css — 2414 IMAGE_TOOLS (PixLocal) 공통 셸 + 공용 컴포넌트
 * 출발점 kit-aurora(둥근 카드·중앙 정렬·Pretendard) → 평면화:
 *   그라디언트/글래스/블러/글로우/큰 그림자 없음 · 1px 헤어라인 · 딥 틸 단색 액센트.
 * 도구별 스타일은 /assets/tools/<tool>.css 에 둔다(이 파일은 공용만).
 */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
  --r-s: 8px; --r-m: 12px; --r-l: 18px;
  --wrap: 1120px;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, canvas, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ico { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.mono { font-family: var(--mono); }

/* ─── HEADER ─── */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { max-width: var(--wrap); margin: 0 auto; height: 58px; padding: 0 16px; display: flex; align-items: center; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 800; letter-spacing: -0.02em; font-size: 1.08rem; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-fg); display: inline-flex; align-items: center; justify-content: center; }
.brand-mark svg { width: 18px; height: 18px; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a { color: var(--ink-2); font-size: .9rem; font-weight: 600; padding: 7px 10px; border-radius: var(--r-s); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.hdr-tools { display: flex; align-items: center; gap: 6px; }
.lang-select { height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-s); padding: 0 8px; font-size: .85rem; max-width: 110px; }
.icon-btn { width: 34px; height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-s); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .nav { display: none; position: absolute; top: 58px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 8px 12px 12px; gap: 2px; }
  .nav.open { display: flex; }
  .nav a { padding: 11px 12px; }
  .hdr-tools { margin-left: auto; }
}
@media (min-width: 861px) { .hdr-tools { margin-left: 8px; } }

/* ─── LAYOUT ─── */
main { flex: 1; width: 100%; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 22px 16px 48px; }
.narrow { max-width: 820px; }

/* ─── HUB (index) ─── */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 8px; }
.hub-card { display: flex; flex-direction: column; gap: 10px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); color: var(--ink); transition: border-color .15s; min-height: 170px; }
.hub-card:hover { border-color: var(--accent); text-decoration: none; }
.hub-card .hc-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.hub-card .hc-ico svg { width: 24px; height: 24px; }
.hub-card h2 { margin: 4px 0 0; font-size: 1.12rem; letter-spacing: -0.01em; }
.hub-card p { margin: 0; color: var(--ink-2); font-size: .92rem; line-height: 1.5; }
.hub-card .hc-go { margin-top: auto; color: var(--accent); font-weight: 700; font-size: .88rem; display: inline-flex; align-items: center; gap: 4px; }
.local-strip { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); color: var(--ink-2); font-size: .92rem; }
.local-strip svg { color: var(--accent); }
.local-strip b { color: var(--ink); }

/* ─── TOOL PAGE ─── */
.tool-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 4px 0 16px; }
.tool-head h1 { margin: 0; font-size: 1.5rem; letter-spacing: -0.02em; line-height: 1.25; }
.local-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .8rem; font-weight: 700; }
.local-badge svg { width: 14px; height: 14px; }
.tool-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 16px; padding-bottom: 2px; scrollbar-width: none; }
.tool-tabs a { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); background: var(--surface); font-size: .86rem; font-weight: 600; }
.tool-tabs a:hover { text-decoration: none; color: var(--ink); border-color: var(--line-2); }
.tool-tabs a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.tool-tabs svg { width: 16px; height: 16px; }

.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.tool-layout.wide-side { grid-template-columns: minmax(0, 1fr) 380px; }
@media (max-width: 900px) { .tool-layout, .tool-layout.wide-side { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px; }
.panel + .panel { margin-top: 14px; }
.panel-title { margin: 0 0 12px; font-size: .95rem; font-weight: 800; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.stack > * + * { margin-top: 14px; }

/* dropzone */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; min-height: 190px; padding: 26px 18px; border: 1.5px dashed var(--line-2); border-radius: var(--r-l); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; outline: none; }
.dropzone:hover, .dropzone:focus-visible, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .dz-ico { width: 46px; height: 46px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.dropzone .dz-ico svg { width: 24px; height: 24px; }
.dropzone strong { font-size: 1.02rem; }
.dropzone .dz-sub { color: var(--ink-2); font-size: .88rem; }
.dropzone .dz-local { margin-top: 6px; display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-size: .8rem; font-weight: 700; }
.dropzone .dz-local svg { width: 14px; height: 14px; }
.dropzone.compact { min-height: 0; padding: 14px; flex-direction: row; gap: 10px; }
.dropzone.compact .dz-ico { width: 32px; height: 32px; margin: 0; }
.dropzone.compact .dz-sub, .dropzone.compact .dz-local { display: none; }

/* form controls */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { font-size: .84rem; font-weight: 700; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.field-label output, .field > label output { color: var(--ink); font-family: var(--mono); font-weight: 600; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .field { flex: 1 1 120px; }
.input, .select, textarea.input { width: 100%; height: 40px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--surface); padding: 0 11px; font-size: .95rem; }
textarea.input { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; }
.input:focus, .select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.input-unit { position: relative; }
.input-unit .input { padding-right: 42px; }
.input-unit span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: .85rem; pointer-events: none; }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 24px; }
input[type="color"] { width: 44px; height: 40px; border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 3px; background: var(--surface); cursor: pointer; }
.check { display: flex; align-items: center; gap: 8px; font-size: .92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.hint { color: var(--ink-3); font-size: .8rem; line-height: 1.45; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; background: var(--surface-2); border-radius: 10px; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; font-size: .86rem; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"], .seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: .84rem; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.chip:hover { color: var(--ink); border-color: var(--ink-3); }
.chip[aria-pressed="true"], .chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 42px; padding: 0 16px; border-radius: var(--r-m); border: 1px solid var(--line-2); background: var(--surface); font-weight: 700; font-size: .93rem; cursor: pointer; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-sm { height: 34px; padding: 0 11px; font-size: .84rem; border-radius: var(--r-s); }
.btn-block { width: 100%; }
.btn svg { width: 17px; height: 17px; }

/* preview stage & transparency checker */
.stage { position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-l); min-height: 260px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.checker { background-color: var(--checker-a); background-image: linear-gradient(45deg, var(--checker-b) 25%, transparent 25%), linear-gradient(-45deg, var(--checker-b) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--checker-b) 75%), linear-gradient(-45deg, transparent 75%, var(--checker-b) 75%); background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0; }
.stage canvas, .stage img { display: block; max-width: 100%; max-height: 70vh; }
.stage-empty { color: var(--ink-3); font-size: .9rem; padding: 30px; text-align: center; }
.busy { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; background: color-mix(in srgb, var(--surface) 82%, transparent); font-weight: 700; font-size: .92rem; z-index: 3; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* before/after compare slider (IT.compare) */
.compare { position: relative; overflow: hidden; border-radius: var(--r-m); user-select: none; touch-action: none; background: var(--surface-2); line-height: 0; }
.compare img { display: block; width: 100%; height: auto; pointer-events: none; }
.compare .cmp-after { position: absolute; inset: 0; clip-path: inset(0 0 0 50%); }
.compare .cmp-after img { width: 100%; height: 100%; object-fit: contain; }
.compare .cmp-bar { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: var(--surface); box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.compare .cmp-knob { position: absolute; top: 50%; left: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; cursor: ew-resize; color: var(--ink-2); line-height: 1; }
.compare .cmp-lbl { position: absolute; top: 10px; padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,.62); color: #fff; font-size: .74rem; font-weight: 700; line-height: 1.4; }
.compare .cmp-lbl.l { left: 10px; } .compare .cmp-lbl.r { right: 10px; }
.compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }

/* results list (IT.results) */
.results { display: flex; flex-direction: column; gap: 8px; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.results-head .rh-sum { color: var(--ink-2); font-size: .88rem; }
.res-item { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
.res-thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.res-name { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-meta { color: var(--ink-2); font-size: .8rem; font-family: var(--mono); }
.res-meta .down { color: var(--ok); font-weight: 700; }
.res-meta .up { color: var(--danger); font-weight: 700; }
.res-err { color: var(--danger); font-size: .82rem; }
.res-actions { display: flex; gap: 6px; }

/* ─── CONTENT PAGES ─── */
.crumb { font-size: .82rem; color: var(--ink-3); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumb a { color: var(--ink-2); }
.page-head { margin: 4px 0 22px; }
.page-head .eyebrow { display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.page-head h1 { margin: 0 0 10px; font-size: clamp(1.5rem, 3.6vw, 2.1rem); letter-spacing: -0.025em; line-height: 1.25; }
.page-head p { margin: 0; color: var(--ink-2); font-size: 1.02rem; }
.page-meta { margin-top: 10px; color: var(--ink-3); font-size: .82rem; }
.prose { font-size: 1.01rem; line-height: 1.8; }
.prose h2 { font-size: 1.28rem; margin: 2.1em 0 .6em; letter-spacing: -0.015em; line-height: 1.35; }
.prose h3 { font-size: 1.06rem; margin: 1.6em 0 .4em; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin: .3em 0; }
.prose blockquote { margin: 1.2em 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--r-s) var(--r-s) 0; color: var(--ink-2); }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0 1.4em; font-size: .92rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 700; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose a.btn { text-decoration: none; }
.cta-box { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 1.6em 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
.cta-box p { margin: 0; font-weight: 700; }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 0 0 1.6em; }
.fact { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
.fact span { display: block; font-size: .76rem; color: var(--ink-3); font-weight: 700; }
.fact b { font-size: .95rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.link-card { display: block; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); color: var(--ink); }
.link-card:hover { border-color: var(--accent); text-decoration: none; }
.link-card h3 { margin: 0 0 6px; font-size: 1rem; }
.link-card p { margin: 0; color: var(--ink-2); font-size: .88rem; line-height: 1.5; }
.link-card .lc-tag { display: inline-block; margin-bottom: 8px; font-size: .72rem; font-weight: 800; color: var(--accent); letter-spacing: .04em; text-transform: uppercase; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; }
.pager a { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); color: var(--ink-2); font-size: .82rem; }
.pager a b { display: block; color: var(--ink); font-size: .92rem; margin-top: 2px; }
.pager a.next { text-align: right; }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.tool-notes { margin-top: 28px; }
.tool-notes h2 { font-size: 1.1rem; margin: 28px 0 10px; }
.tool-notes > h2:first-child { margin-top: 0; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.steps li { counter-increment: s; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); font-size: .93rem; }
.steps li::before { content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: .8rem; display: inline-flex; align-items: center; justify-content: center; }
.faq-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.faq-item h3 { margin: 0 0 6px; font-size: 1rem; }
.faq-item p { margin: 0; color: var(--ink-2); }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 0 0 1em; }
.feature { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
.feature h3 { margin: 0 0 4px; font-size: .98rem; }
.feature p { margin: 0; font-size: .9rem; color: var(--ink-2); line-height: 1.55; }

/* ─── ADS (래퍼에 border-radius·overflow 금지 — architecture.md §4-1) ─── */
.ad-wrap { margin: 26px auto 0; }
.ad-grid { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: 672px; margin-left: auto; margin-right: auto; }
.ad-grid[data-ad-layout="mixed"] { max-width: 760px; }
.ad-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: 100%; }
.ad-cell { min-height: 50px; max-width: 100%; }
:root[data-ad-media="pc"] .ad-mo { display: none; }
:root[data-ad-media="mo"] .ad-pc { display: none; }

/* ─── FOOTER ─── */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 28px 16px 30px; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 20px; }
.footer-col h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 0 0 10px; }
.footer-col a { display: block; color: var(--ink-2); font-size: .88rem; padding: 3px 0; }
.footer-base { max-width: var(--wrap); margin: 0 auto; padding: 14px 16px 26px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .8rem; display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: space-between; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .9rem; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* RTL */
[dir="rtl"] .prose ul, [dir="rtl"] .prose ol { padding-left: 0; padding-right: 1.3em; }
[dir="rtl"] .prose blockquote { border-left: 0; border-right: 3px solid var(--accent); border-radius: var(--r-s) 0 0 var(--r-s); }
[dir="rtl"] .pager a.next { text-align: left; }
[dir="rtl"] .input-unit .input { padding-right: 11px; padding-left: 42px; }
[dir="rtl"] .input-unit span { right: auto; left: 11px; }
[dir="rtl"] .nav { margin-left: 0; margin-right: auto; }
