/* 바깥 페이지 디자인: 변환기 화면(src/styles.css)과 같은 녹색 브랜드 · 밝은/어두운 화면은 기기 설정을 따름
   기준 폭: 320 · 360 · 390 · 414 · 768 · 1024 · 1280 · 1366 · 1440 · 1920 · 2560 (가로 넘침·잘림 없음, 큰 화면은 최대 폭 1200 가운데) */
:root {
    --bg: #f6f5f0;
    --bg-elev: #ffffff;
    --surface-2: #f9f8f4;
    --ink: #18211d;
    --ink-soft: #545f59;
    --line: #e2dfd6;
    --line-strong: #cbc6b9;
    --green: #1d6b47;
    --green-dark: #15533a;
    --green-tint: #e8f3ed;
    --green-soft: #c9e3d4;
    --btn: #1d6b47;
    --btn-hover: #15533a;
    --focus: #2f8f62;
    --pdf-red: #c8463b;
    --hero-glow: rgba(29, 107, 71, 0.12);
    --shadow-sm: 0 1px 2px rgba(24, 33, 29, 0.05);
    --shadow: 0 1px 2px rgba(24, 33, 29, 0.04), 0 6px 20px rgba(24, 33, 29, 0.06);
    --shadow-lg: 0 2px 4px rgba(24, 33, 29, 0.04), 0 18px 40px rgba(24, 60, 40, 0.12);
    --radius: 16px;
    --radius-sm: 12px;
    --gutter: clamp(16px, 4vw, 32px);
    --head-h: 64px;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0e1311;
        --bg-elev: #151c19;
        --surface-2: #1a2320;
        --ink: #e5ebe8;
        --ink-soft: #a6b2ac;
        --line: #26302c;
        --line-strong: #3a4842;
        --green: #5cc493;
        --green-dark: #7fd6ab;
        --green-tint: #15291f;
        --green-soft: #24493a;
        --btn: #237a52;
        --btn-hover: #2a8c5f;
        --focus: #7fd6ab;
        --pdf-red: #e0705f;
        --hero-glow: rgba(92, 196, 147, 0.1);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 18px 40px rgba(0, 0, 0, 0.45);
    }
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--head-h) + 12px);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Malgun Gothic', '맑은 고딕', 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.65;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
}

/* 한국어는 낱말 중간에서 줄을 바꾸지 않음 ('바/로' 같은 어색한 줄바꿈 방지) */
:lang(ko) {
    word-break: keep-all;
}

a {
    color: var(--green);
    text-underline-offset: 3px;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 6px;
}

.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding-inline: var(--gutter);
}

.skip {
    position: absolute;
    left: -9999px;
}

.skip:focus {
    left: 12px;
    top: 12px;
    z-index: 50;
    background: var(--bg-elev);
    padding: 10px 14px;
    border-radius: 8px;
}

/* ── 머리글 (한 줄) ───────────────────────────────────── */
.site-head {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}

.head-row {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: var(--head-h);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    text-decoration: none;
    color: var(--ink);
    flex: none;
}

.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #1d6b47 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M9 10h14M9 16h14M9 22h14M16 10v12' stroke='white' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% no-repeat;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
    flex: none;
}

.brand-name {
    font-weight: 800;
    font-size: 19px;
    letter-spacing: -0.015em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 10px;
    border-radius: 10px;
    color: var(--ink);
    text-decoration: none;
    font-size: 14.5px;
    white-space: nowrap;
}

.site-nav a:hover {
    background: var(--green-tint);
}

.site-nav a[aria-current] {
    color: var(--green-dark);
    font-weight: 700;
    background: var(--green-tint);
}

.head-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    min-width: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    text-decoration: none;
    font-size: 14px;
    background: var(--bg-elev);
}

.lang-switch:hover {
    border-color: var(--green-soft);
    background: var(--green-tint);
}

.globe {
    width: 16px;
    height: 16px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c2.5 2.6 3.8 5.6 3.8 9s-1.3 6.4-3.8 9c-2.5-2.6-3.8-5.6-3.8-9S9.5 5.6 12 3z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c2.5 2.6 3.8 5.6 3.8 9s-1.3 6.4-3.8 9c-2.5-2.6-3.8-5.6-3.8-9S9.5 5.6 12 3z'/%3E%3C/svg%3E") center / contain no-repeat;
    flex: none;
}

.lang-short {
    display: none;
}

.menu-btn {
    display: none;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    min-width: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-elev);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

.menu-ico {
    position: relative;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}

.menu-ico::before,
.menu-ico::after {
    content: '';
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}

.menu-ico::before {
    top: -6px;
}

.menu-ico::after {
    top: 6px;
}

/* 좁은 화면 (태블릿·휴대폰·200% 확대): 메뉴는 [메뉴] 버튼으로 여는 목록 */
@media (max-width: 1239.98px) {
    .menu-btn {
        display: inline-flex;
    }

    .head-tools {
        margin-left: auto;
    }

    /* popover 를 모르는 오래된 브라우저: 머리글 아래 가로로 미는 줄 */
    .head-row {
        flex-wrap: wrap;
    }

    .site-nav {
        order: 3;
        flex-basis: 100%;
        overflow-x: auto;
        margin-left: 0;
    }

    @supports selector(:popover-open) {
        .head-row {
            flex-wrap: nowrap;
        }

        /* (위 .site-nav 의 display:flex 가 브라우저 기본 '닫힌 popover 숨김'을 덮으므로 다시 숨김) */
        .site-nav:not(:popover-open) {
            display: none;
        }

        .site-nav:popover-open {
            position: fixed;
            inset: calc(var(--head-h) + 6px) 12px auto auto;
            width: min(340px, calc(100vw - 24px));
            max-height: calc(100dvh - var(--head-h) - 18px);
            margin: 0;
            padding: 8px;
            overflow: auto;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 2px;
            background: var(--bg-elev);
            color: var(--ink);
            border: 1px solid var(--line);
            border-radius: var(--radius);
            box-shadow: var(--shadow-lg);
        }

        .site-nav:popover-open a {
            min-height: 48px;
            padding: 0 14px;
            font-size: 16px;
        }

        .site-nav::backdrop {
            background: rgba(10, 16, 13, 0.28);
        }
    }
}

@media (min-width: 1240px) {
    /* 넓은 화면: popover 속성이 있어도 늘 보이는 가로 메뉴 */
    .site-nav[popover] {
        display: flex;
        position: static;
        inset: auto;
        width: auto;
        height: auto;
        margin: 0 0 0 auto;
        padding: 0;
        border: 0;
        background: none;
        color: inherit;
        overflow: visible;
    }
}

@media (max-width: 520px) {
    .menu-label,
    .lang-full {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .lang-short {
        display: inline;
        font-weight: 700;
    }

    .menu-btn,
    .lang-switch {
        padding: 0;
        width: 44px;
        justify-content: center;
    }

    .lang-switch .globe {
        display: none;
    }

    .brand-name {
        font-size: 18px;
    }
}

/* ── 본문 틀 ─────────────────────────────────────────── */
.page-grid {
    padding-top: 20px;
    padding-bottom: 72px;
}

.content {
    min-width: 0;
}

.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--ink-soft);
    margin: 0 auto 8px;
}

.crumbs a {
    color: var(--ink-soft);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
}

.crumbs a:hover {
    color: var(--green);
    text-decoration: underline;
}

.content h1,
.content h2 {
    text-wrap: balance;
}

.content h1 {
    font-size: clamp(28px, 3.6vw, 40px);
    line-height: 1.22;
    letter-spacing: -0.025em;
    margin: 0 0 12px;
}

.content h2 {
    font-size: clamp(21px, 2.2vw, 26px);
    line-height: 1.3;
    letter-spacing: -0.015em;
    margin: 52px 0 14px;
}

.content h3 {
    font-size: 18px;
    margin: 28px 0 8px;
}

.lead {
    font-size: clamp(16.5px, 1.5vw, 18.5px);
    line-height: 1.6;
    color: var(--ink-soft);
    margin: 0 0 16px;
}

.block {
    margin-top: 56px;
}

.block > h2 {
    margin-top: 0;
}

/* 읽는 글 (가이드·안내·도구 설명): 가운데 한 단 */
.prose {
    max-width: 780px;
    margin-inline: auto;
}

.is-doc .crumbs {
    max-width: 780px;
}

.prose p,
.prose li {
    line-height: 1.75;
}

.prose ul,
.prose ol {
    padding-left: 1.3em;
}

.prose li + li {
    margin-top: 4px;
}

blockquote {
    margin: 24px 0;
    padding: 14px 18px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-left: 4px solid var(--green);
    border-radius: var(--radius-sm);
}

blockquote p {
    margin: 6px 0;
}

hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 36px 0;
}

.table-wrap {
    overflow-x: auto;
    margin: 18px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-elev);
}

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 15px;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
}

tr:last-child td {
    border-bottom: 0;
}

th + th,
td + td {
    border-left: 1px solid var(--line);
}

th {
    background: var(--surface-2);
    font-weight: 700;
}

pre.licenses {
    white-space: pre-wrap;
    font-size: 13px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 16px;
}

code {
    background: var(--surface-2);
    border: 1px solid var(--line);
    padding: 0 5px;
    border-radius: 5px;
    font-size: 0.92em;
}

.updated {
    margin-top: 40px;
    font-size: 14px;
    color: var(--ink-soft);
}

/* ── 배지 ─────────────────────────────────────────────── */
.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 0 0 18px;
    list-style: none;
}

.badges li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    color: var(--ink);
    border-radius: 999px;
    padding: 5px 12px 5px 9px;
    font-size: 14px;
    font-weight: 600;
}

.badges li::before {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--green-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%231d6b47' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 8.3l2.3 2.2 4.7-5'/%3E%3C/svg%3E") center / 12px no-repeat;
    flex: none;
}

/* ── 버튼 ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16.5px;
    text-decoration: none;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.btn-primary {
    background: var(--btn);
    color: #fff;
    box-shadow: 0 6px 18px rgba(29, 107, 71, 0.28);
}

.btn-primary:hover {
    background: var(--btn-hover);
    transform: translateY(-1px);
}

.btn-ghost {
    background: var(--bg-elev);
    color: var(--ink);
    border: 1px solid var(--line-strong);
}

.btn-ghost:hover {
    border-color: var(--green);
    color: var(--green-dark);
}

/* ── 홈 ───────────────────────────────────────────────── */
.is-hub {
    background: radial-gradient(1100px 520px at 78% -60px, var(--hero-glow), transparent 70%), var(--bg);
    background-repeat: no-repeat;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: clamp(24px, 4vw, 56px);
    align-items: center;
    padding: clamp(20px, 5vw, 64px) 0 clamp(8px, 2vw, 24px);
}

.hero h1 {
    font-size: clamp(31px, 4.8vw, 54px);
    line-height: 1.14;
    letter-spacing: -0.03em;
    margin: 0 0 16px;
}

.hero .lead {
    font-size: clamp(17px, 1.7vw, 20px);
    max-width: 34em;
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 26px 0 20px;
}

.hero-art {
    width: 100%;
    max-width: 420px;
    justify-self: end;
    filter: drop-shadow(0 18px 30px rgba(24, 60, 40, 0.14));
}

.hero-art .pg {
    fill: var(--bg-elev);
    stroke: var(--line-strong);
    stroke-width: 1.5;
}

.hero-art .tag {
    fill: var(--pdf-red);
}

.hero-art .txt {
    stroke: var(--line-strong);
    stroke-width: 6;
    stroke-linecap: round;
}


.hero-art .back {
    fill: var(--bg);
}

.hero-art .gl {
    fill: none;
    stroke: var(--green);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hero-art .tl {
    stroke: var(--line-strong);
    stroke-width: 1.2;
}



.hero-art .hl {
    fill: var(--green-tint);
    stroke: var(--green);
    stroke-width: 2;
}

.hero-art .arrow {
    fill: none;
    stroke: var(--green);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 도구 카드: 모두 같은 크기 (순서·분류·배지는 web/tools.json) · 분류가 2개 이상이면 분류 소제목 아래 묶음 */
.tool-group-h {
    margin: 22px 0 12px;
    font-size: 17px;
    color: var(--ink-soft);
}

.tool-group-h:first-of-type {
    margin-top: 6px;
}

.tool-grid + .tool-group-h {
    margin-top: 30px;
}
.tool-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    text-decoration: none;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.tool-card:hover {
    border-color: var(--green-soft);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.tool-card strong {
    font-size: 19px;
    letter-spacing: -0.01em;
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* 차별점 한 줄 (작게 · 누르는 것이 아님) */
.card-badge {
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.3;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--green-tint);
    color: var(--green);
    text-align: right;
}

.card-text {
    color: var(--ink-soft);
    font-size: 15px;
}

.card-go {
    margin-top: auto;
    padding-top: 6px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--green);
}







.tool-ico {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--green-tint);
    flex: none;
}

.tool-ico::after {
    content: '';
    position: absolute;
    inset: 8px;
    background: var(--green);
    -webkit-mask: var(--ico) center / contain no-repeat;
    mask: var(--ico) center / contain no-repeat;
}









/* 링크 카드 (가이드·관련 글) */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 14px;
}

.link-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 16px 18px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.link-card:hover {
    border-color: var(--green-soft);
    box-shadow: var(--shadow);
}

.link-card strong {
    color: var(--green-dark);
    font-size: 16px;
    line-height: 1.45;
}

.link-card span {
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.55;
}

/* 다른 도구 (작은 카드) */
.mini-tools {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
    gap: 10px;
}

.mini-tool {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 8px 14px 8px 8px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}

.mini-tool:hover {
    border-color: var(--green-soft);
    color: var(--green-dark);
}

.mini-tool .tool-ico {
    width: 38px;
    height: 38px;
}

/* 업로드 없음 안내 한 줄 */
.privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 0 0;
    padding: 12px 16px;
    background: var(--green-tint);
    border: 1px solid var(--green-soft);
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--ink);
}

.privacy-note strong {
    color: var(--green-dark);
}

.privacy-note a {
    font-weight: 700;
    white-space: nowrap;
}

.lock {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex: none;
    background: var(--green);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='4' y='10' width='16' height='11' rx='2'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='4' y='10' width='16' height='11' rx='2'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.is-hub .privacy-note {
    margin-top: 28px;
}

/* ── 도구 페이지 ─────────────────────────────────────── */
.is-tool .crumbs,
.tool-head,
.tool-wrap,
.is-tool .block {
    max-width: 1000px;
    margin-inline: auto;
}

.tool-head {
    text-align: center;
    padding: clamp(4px, 2vw, 20px) 0 4px;
}

.tool-head .lead {
    max-width: 720px;
    margin-inline: auto;
}

.tool-wrap .badges {
    justify-content: center;
}

/* 도구 칸 (격리 iframe): 처음부터 높이를 잡아 두어 불러온 뒤 화면이 밀리지 않게 */
.tool-frame {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
    box-shadow: var(--shadow-lg);
}

/* (첫 높이는 각 칸의 실제 첫 화면 높이에 맞춤 — 칸이 높이를 알려 오기 전후로 아래 내용이 밀리지 않게) */
.tool-frame iframe {
    display: block;
    width: 100%;
    height: 287px;
    border: 0;
    background: transparent;
}

.tool-frame[data-tool='merge-pdf'] iframe,
.tool-frame[data-tool='pdf-to-word'] iframe {
    height: 379px;
}

.tool-frame[data-tool='split-pdf'] iframe,
.tool-frame[data-tool='compress-pdf'] iframe {
    height: 359px;
}

.tool-frame[data-tool='pdf-to-ppt'] iframe {
    height: 449px;
}

/* 단계 카드 (순서 목록) */
.step-cards {
    list-style: none;
    counter-reset: step;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 0 !important;
    margin: 18px 0;
}

.step-cards li {
    counter-increment: step;
    position: relative;
    margin: 0 !important;
    padding: 50px 18px 16px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    line-height: 1.6;
}

.step-cards li::before {
    content: counter(step);
    position: absolute;
    left: 18px;
    top: 16px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--btn);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: grid;
    place-items: center;
}

.step-cards li > strong:first-child {
    display: block;
    margin-bottom: 2px;
}

/* 특징 카드 (굵은 머리말로 시작하는 목록) */
.feature-cards {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 0 !important;
    margin: 18px 0;
}

.feature-cards li {
    position: relative;
    margin: 0 !important;
    padding: 16px 18px 16px 50px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 15px;
    line-height: 1.65;
}

.feature-cards li::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 18px;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: var(--green-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%231d6b47' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 8.3l2.3 2.2 4.7-5'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.feature-cards li > strong:first-child {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

/* 질문·답 접기 */
.qa {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    margin: 10px 0;
}

.qa summary {
    position: relative;
    list-style: none;
    cursor: pointer;
    min-height: 52px;
    padding: 14px 52px 14px 18px;
    font-weight: 700;
    line-height: 1.5;
}

.qa summary::-webkit-details-marker {
    display: none;
}

.qa summary::after {
    content: '';
    position: absolute;
    right: 20px;
    top: 50%;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--ink-soft);
    border-bottom: 2px solid var(--ink-soft);
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.15s;
}

.qa[open] summary::after {
    transform: translateY(-30%) rotate(-135deg);
}

.qa summary h3 {
    display: inline;
    font-size: inherit;
    margin: 0;
}

.qa summary:hover {
    color: var(--green-dark);
}

.qa-a {
    padding: 0 18px 6px;
    color: var(--ink);
}

.qa-a p:first-child {
    margin-top: 0;
}

/* ── 광고 자리: 크기 고정 (광고가 늦게 떠도 화면이 밀리지 않음) ──
   넓은 화면(1820px~ · 본문 폭 1136 을 줄이지 않고, 본문과 150px 넘게 떨어져 들어갈 때만): 본문 바깥 양옆 세로 레일. 오른쪽만 스크롤을 따라옴(sticky) — AdSense 세로 고정 광고 조건
   (폭 300px 이하·화면에 고정 광고 1개·양쪽 대칭 고정 금지·본문과 겹치지 않음·데스크톱만). 본문 중간 광고는 숨김
   좁은 화면: 레일 없음, 본문 중간 1개 (도구 칸 아래면 150px 이상 떨어뜨림) · 화면을 덮거나 바닥에 붙는 광고 없음 */
.ad {
    margin: 36px auto;
    text-align: center;
}

/* 도구 바로 아래에 오는 본문 중간 광고: 칸 맨 아래 버튼(받기·합치기 등)에서 150px 넘게 떨어뜨림 */
.tool-wrap + .ad {
    margin-top: 150px;
}

.ad-label {
    display: block;
    font-size: 12px;
    color: var(--ink-soft);
    margin-bottom: 4px;
}

.ad-box {
    display: inline-block;
    max-width: 100%;
}

.ad-inContent .ad-box {
    width: 336px;
    height: 280px;
}

@media (max-width: 760px) {
    .ad-inContent .ad-box {
        width: 300px;
        height: 250px;
    }
}

.rail {
    display: none;
}

/* 본문 칸은 레일이 없을 때와 같은 1136px (1200 - 좌우 여백 32×2) — 레일이 본문을 누르지 않음
   레일과 본문 사이 150px (본문 카드·도구 칸·버튼과 광고를 150px 넘게 떨어뜨림): 1136 + (160 + 150)×2 + 여백 64 = 1820 */
@media (min-width: 1820px) {
    .page-grid.has-rails {
        --rail: 160px;
        display: grid;
        grid-template-columns: var(--rail) minmax(0, 1136px) var(--rail);
        justify-content: center;
        gap: 150px;
        max-width: none;
    }

    .has-rails .rail {
        display: block;
    }

    .has-rails .ad-inContent {
        display: none;
    }

    .rail .ad {
        margin: 8px 0 0;
    }

    .rail .ad-box {
        width: var(--rail);
        height: 600px;
    }

    /* 화면에 고정되는 광고는 오른쪽 하나뿐 (머리글 아래에서 멈추고, 레일 칸이 끝나면 바닥글 전에 함께 올라감) */
    .rail-right .ad {
        position: sticky;
        top: calc(var(--head-h) + 20px);
    }
}

/* 300×600: 1136 + (300 + 150)×2 + 64 = 2100 */
@media (min-width: 2100px) {
    .page-grid.has-rails {
        --rail: 300px;
    }
}

.ad-preview .ad-box {
    border: 2px dashed var(--line-strong);
    border-radius: 8px;
    color: var(--ink-soft);
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── 바닥글 ───────────────────────────────────────────── */
.site-foot {
    background: var(--bg-elev);
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 14px;
    padding: 48px 0 28px;
}

.foot-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
    gap: 32px;
}

.foot-brand p {
    margin: 10px 0 0;
    max-width: 30em;
    line-height: 1.6;
}

.foot-col h2 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--ink);
    margin: 4px 0 8px;
}

.foot-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.foot-col a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    color: var(--ink-soft);
    text-decoration: none;
}

.foot-col a:hover {
    color: var(--green);
    text-decoration: underline;
}

.foot-notes {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.foot-notes p {
    margin: 4px 0;
}

.copy {
    margin: 16px 0 0;
    font-size: 13px;
}

/* 404 */
.chooser {
    max-width: 560px;
    margin: 12vh auto;
    padding: 0 20px;
}

.chooser-brand {
    font-size: 22px;
    margin-bottom: 24px;
}

/* ── 화면 폭별 ───────────────────────────────────────── */
@media (max-width: 1023.98px) {
    .foot-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .foot-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 860px) {
    .hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-art {
        display: none;
    }
}

@media (max-width: 760px) {
    .page-grid {
        padding-top: 12px;
    }

    .step-cards,
    .feature-cards {
        grid-template-columns: minmax(0, 1fr);
    }

    .tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* 2단에서 묶음의 마지막 카드가 혼자 남으면 한 줄을 다 씀 */
    .tool-card:last-child:nth-child(odd) {
        grid-column: span 2;
    }

    .tool-frame {
        padding: 8px;
        border-radius: 14px;
    }

    .tool-frame iframe {
        height: 311px;
    }

    .tool-frame[data-tool='merge-pdf'] iframe,
    .tool-frame[data-tool='pdf-to-word'] iframe {
        height: 532px;
    }

    .tool-frame[data-tool='split-pdf'] iframe,
    .tool-frame[data-tool='compress-pdf'] iframe {
        height: 511px;
    }

    .tool-frame[data-tool='pdf-to-ppt'] iframe {
        height: 710px;
    }

    .foot-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 16px;
    }

    .foot-col a {
        min-height: 44px;
        min-width: 44px;
    }

    .cta-row .btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 560px) {
    .tool-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .tool-card:last-child:nth-child(odd) {
        grid-column: auto;
    }

    .tool-card {
        padding: 18px;
    }

    .tool-head {
        text-align: left;
    }

    .tool-wrap .badges {
        justify-content: flex-start;
    }

    /* 누르는 영역은 44px 이되 글자 사이 간격은 그대로 보이게 (영역끼리 겹쳐 둠) */
    .crumbs a {
        min-height: 44px;
        min-width: 44px;
        justify-content: center;
        margin-inline: -12px;
    }
}

/* 손가락 입력 기기(휴대폰 가로·태블릿 포함): 작은 링크도 누르는 영역 44px */
@media (pointer: coarse) {
    .foot-col a,
    /* 누르는 영역은 44px 이되 글자 사이 간격은 그대로 보이게 (영역끼리 겹쳐 둠) */
    .crumbs a {
        min-height: 44px;
        min-width: 44px;
        justify-content: center;
        margin-inline: -12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
    }
}

@media (prefers-color-scheme: dark) {
    .badges li::before,
    .feature-cards li::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%237fd6ab' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 8.3l2.3 2.2 4.7-5'/%3E%3C/svg%3E");
    }

    .hero-art {
        filter: none;
    }

    .btn-primary {
        box-shadow: none;
    }
}

/* 한국어: 괄호·따옴표가 붙은 낱말 한 덩어리 (build-web.mjs keepKoWords) */
.nw {
    white-space: nowrap;
}

/* 도구 아이콘 (web/tools.json 에서 만듦) */
.tool-ico-merge-pdf {
    --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='8' height='11' rx='1'/%3E%3Crect x='13' y='3' width='8' height='11' rx='1'/%3E%3Cpath d='M7 17v2h10v-2M12 19v2'/%3E%3C/svg%3E");
}

.tool-ico-compress-pdf {
    --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2h9l4 4v16H6z'/%3E%3Cpath d='M12 6v4M10 8l2 2 2-2M12 18v-4M10 16l2-2 2 2'/%3E%3C/svg%3E");
}

.tool-ico-split-pdf {
    --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='2' width='10' height='9' rx='1'/%3E%3Cpath d='M12 11v3M12 14l-5 3M12 14l5 3'/%3E%3Crect x='3' y='17' width='7' height='5' rx='1'/%3E%3Crect x='14' y='17' width='7' height='5' rx='1'/%3E%3C/svg%3E");
}

.tool-ico-pdf-to-word {
    --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2h9l4 4v16H6z'/%3E%3Cpath d='M8.5 10l1.5 7 2-5 2 5 1.5-7'/%3E%3C/svg%3E");
}

.tool-ico-pdf-to-excel {
    --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='1.5'/%3E%3Cpath d='M3 10h18M3 14.5h18M9 5v14M15 5v14'/%3E%3C/svg%3E");
}

.tool-ico-pdf-to-ppt {
    --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='13' rx='1.5'/%3E%3Cpath d='M12 17v3M8 21h8M8 13V9M12 13V7M16 13v-2'/%3E%3C/svg%3E");
}
