/*
 * 파일명: style.css
 * 파일경로: /home/hwptool/public_html/assets/css/
 * 기능: 사이트 전역 스타일 — Design System 03 (다크 모노 클린)
 * 작성일: 2026-09-01
 * 수정일: 2026-09-03
 */

/* ==========================================================================
   1. 디자인 토큰 — 기존 색상은 유지하고 비례·간격·형태만 다시 잡는다
   ========================================================================== */
:root {
    --color-bg:           #fbfbfc;
    --color-surface:      #ffffff;
    --color-dot:          #dcdde3;

    --color-accent:       #111317;
    --color-accent-dark:  #000000;
    --color-on-accent:    #ffffff;

    --color-link:         #2563eb;

    --color-text:         #0c0d10;
    --color-text-muted:   #71757e;

    --color-border:       #d4d6dd;

    --color-success:      #16a34a;
    --color-good:         #2563eb;
    --color-warning:      #f59e0b;
    --color-danger:       #ef4444;

    --color-track:         #eceef2;
    --color-disabled-bg:   #e6e7ea;
    --color-disabled-text: #a2a5ac;

    --shadow:        0 1px 2px rgba(16, 18, 24, .04), 0 12px 36px rgba(16, 18, 24, .06);
    --shadow-strong: 0 18px 48px rgba(16, 18, 24, .10);

    --radius:       10px;
    --radius-small: 7px;
    --radius-pill:  999px;

    --font-sans: "Pretendard", "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Noto Sans KR", monospace;

    --wrap:       1120px;
    --reading:    760px;
    --section-y:  76px;
    --header-h:   68px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-bg:          #0d0d0d;
        --color-surface:     #1a1a1a;
        --color-dot:         #232326;

        --color-accent:      #f0f0f0;
        --color-accent-dark: #ffffff;
        --color-on-accent:   #111317;

        --color-text:        #e0e0e0;
        --color-text-muted:  #888888;
        --color-border:      #333333;

        --color-link:        #60a5fa;
        --color-good:        #60a5fa;
        --color-success:     #22c55e;
        --color-warning:     #fbbf24;
        --color-danger:      #f87171;

        --color-track:         #2a2a2e;
        --color-disabled-bg:   #2a2a2e;
        --color-disabled-text: #6b6b70;

        --shadow:        0 1px 2px rgba(0, 0, 0, .5), 0 12px 36px rgba(0, 0, 0, .36);
        --shadow-strong: 0 18px 48px rgba(0, 0, 0, .48);
    }
}

/* ==========================================================================
   2. 기본 조판
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
    min-width: 320px;
    scrollbar-gutter: stable;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    word-break: keep-all;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

main { min-height: calc(100vh - var(--header-h)); }

h1, h2, h3 {
    margin: 0;
    color: var(--color-text);
    line-height: 1.22;
    letter-spacing: -.035em;
}

h1 { font-size: clamp(36px, 5vw, 54px); font-weight: 800; }
h2 { font-size: clamp(26px, 3vw, 34px); font-weight: 760; }
h3 { font-size: 19px; font-weight: 740; }

p { margin: 0 0 18px; }

a {
    color: var(--color-link);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; }
code, pre, .mono { font-family: var(--font-mono); }

::selection {
    background: color-mix(in srgb, var(--color-link) 22%, transparent);
}

:focus-visible {
    outline: 2px solid var(--color-link);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 200;
    padding: 9px 14px;
    border-radius: var(--radius-small);
    background: var(--color-accent);
    color: var(--color-on-accent);
    font-size: 14px;
    font-weight: 700;
    transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: 24px;
}

.lead {
    max-width: 680px;
    color: var(--color-text-muted);
    font-size: clamp(17px, 2vw, 20px);
    line-height: 1.65;
    letter-spacing: -.012em;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   3. 헤더 · 푸터
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--color-surface) 94%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-h);
    gap: 28px;
}

.brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 11px;
    color: var(--color-text);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.025em;
    text-decoration: none;
}

.brand:hover { text-decoration: none; }

.brand-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--color-accent);
    color: var(--color-on-accent);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -.04em;
}

.site-nav {
    display: flex;
    align-self: stretch;
    gap: 26px;
}

.site-nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}

.site-nav a::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: var(--color-accent);
    content: "";
    opacity: 0;
    transform: scaleX(.4);
    transition: opacity 140ms ease, transform 140ms ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--color-text); }

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
    opacity: 1;
    transform: scaleX(1);
}

.site-footer {
    margin-top: 96px;
    padding: 52px 0 30px;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-size: 13px;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(240px, .8fr) minmax(420px, 1.2fr);
    gap: 64px;
    padding-bottom: 38px;
}

.footer-brand {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--color-text);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.03em;
    text-decoration: none;
}

.footer-brand:hover { text-decoration: none; }
.footer-about p { max-width: 360px; margin: 0; }
.footer-meta { justify-self: end; }

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 24px;
    margin-bottom: 18px;
}

.footer-nav a { color: var(--color-text); font-weight: 650; }
.footer-updated { margin: 0; text-align: right; }
.footer-updated span { padding-inline: 8px; color: var(--color-border); }

.footer-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
    padding-top: 26px;
    border-top: 1px solid var(--color-border);
}

.footer-disclaimer { max-width: 660px; margin: 0; }
.footer-copy { flex: 0 0 auto; margin: 0; }

/* ==========================================================================
   4. 첫 화면
   ========================================================================== */
.hero {
    padding: 92px 0 78px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
    align-items: end;
    gap: clamp(56px, 9vw, 120px);
}

.hero h1 {
    max-width: 800px;
    margin-bottom: 26px;
    font-size: clamp(44px, 6.5vw, 72px);
    line-height: 1.08;
    letter-spacing: -.055em;
}

.hero .lead { margin-bottom: 32px; }

.hero-note {
    margin: 18px 0 0;
    color: var(--color-text-muted);
    font-size: 13px;
}

.hero-facts {
    margin: 0;
    border-top: 1px solid var(--color-text);
}

.hero-facts div {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 16px;
    padding: 17px 0;
    border-bottom: 1px solid var(--color-border);
}

.hero-facts dt {
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 650;
}

.hero-facts dd {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    text-align: right;
}

.section { padding: var(--section-y) 0; }

.section-intro {
    display: grid;
    grid-template-columns: minmax(260px, .8fr) minmax(300px, 1.2fr);
    align-items: end;
    gap: 48px;
    margin-bottom: 34px;
}

.section-intro p {
    max-width: 560px;
    margin: 0;
    justify-self: end;
    color: var(--color-text-muted);
    font-size: 15px;
}

.tool-directory { border-top: 1px solid var(--color-text); }

.tool-entry {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: start;
    gap: 24px;
    padding: 30px 0;
    border-bottom: 1px solid var(--color-border);
}

.tool-entry h3 { margin-bottom: 8px; font-size: 23px; }

.tool-entry p {
    max-width: 680px;
    margin: 0;
    color: var(--color-text-muted);
    font-size: 15px;
}

.tool-number {
    padding-top: 4px;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
}

.tool-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 3px;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 750;
    white-space: nowrap;
    text-decoration: none;
}

.tool-link span { color: var(--color-link); font-size: 17px; }
.tool-link:hover { color: var(--color-link); text-decoration: none; }

.tool-entry .tool-options {
    display: flex;
    gap: 18px;
    margin-top: 12px;
    font-size: 13px;
}

.tool-options a { font-weight: 650; }

.support-section {
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}

.support-grid {
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    border-top: 1px solid var(--color-text);
    border-bottom: 1px solid var(--color-border);
}

.support-block { padding: 28px 32px 30px 0; }
.support-block + .support-block { padding-left: 32px; border-left: 1px solid var(--color-border); }
.support-block h3 { margin-bottom: 14px; font-size: 15px; }

.service-notice { padding-top: 54px; padding-bottom: 0; }

.service-note {
    max-width: 900px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 14px;
}

.service-note strong { color: var(--color-text); }
.service-note p:last-child { margin-bottom: 0; }

/* 이전 마크업과 문서형 부품을 위한 기본 그리드 */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }

.card {
    padding: 24px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
}

.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }

/* ==========================================================================
   5. 버튼 · 상태
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 19px;
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-small);
    background: var(--color-accent);
    color: var(--color-on-accent);
    font-family: inherit;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn:hover {
    border-color: var(--color-accent-dark);
    background: var(--color-accent-dark);
    text-decoration: none;
}

.btn-ghost {
    border-color: var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
}

.btn-ghost:hover {
    border-color: var(--color-text-muted);
    background: color-mix(in srgb, var(--color-text) 4%, var(--color-surface));
}

.btn-quiet {
    border-color: var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
}

.btn-quiet:hover {
    border-color: var(--color-text-muted);
    background: color-mix(in srgb, var(--color-text) 4%, transparent);
    color: var(--color-text);
}

.btn:disabled,
.btn[aria-disabled="true"] {
    border-color: transparent;
    background: var(--color-disabled-bg);
    color: var(--color-disabled-text);
    cursor: not-allowed;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.alert {
    position: relative;
    margin-bottom: 18px;
    padding: 11px 0 12px;
    border: 0;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 14px;
}

.alert strong { color: var(--color-text); }
.alert p:last-child { margin-bottom: 0; }

.alert-error {
    border-bottom-color: var(--color-danger);
}

.alert-info {
    border-bottom-color: var(--color-link);
}

.alert-notice {
    border-bottom-color: var(--color-warning);
}

.status-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 26px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
}

.support-block:last-child .status-list { grid-template-columns: 1fr; }

.status-list li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
}

.status-list li:last-child { border-bottom: 0; }
.status-ok { color: var(--color-success); font-weight: 800; }
.status-warn { color: var(--color-warning); font-weight: 800; }
.status-bad { color: var(--color-danger); font-weight: 800; }

.badge {
    display: inline-block;
    padding: 3px 9px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-track);
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 750;
    line-height: 1.5;
    vertical-align: middle;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-track);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ==========================================================================
   6. 도구 진입 화면
   ========================================================================== */
.tool-head {
    padding-top: 58px;
    padding-bottom: 28px;
}

.tool-head h1 { margin-bottom: 12px; font-size: clamp(34px, 4vw, 48px); }

.tool-intro {
    display: block;
}

.dropzone {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    padding: 70px 56px 62px;
    border: 1px solid var(--color-border);
    border-radius: 26px;
    background: var(--color-surface);
    box-shadow: var(--shadow-strong);
    text-align: center;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.dropzone-icon {
    display: grid;
    position: relative;
    z-index: 1;
    place-items: center;
    width: 72px;
    height: 72px;
    margin-bottom: 22px;
    border-radius: 20px;
    background-color: color-mix(in srgb, var(--color-link) 12%, var(--color-surface));
    color: var(--color-link);
}

.dropzone-icon svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.dropzone::after {
    position: absolute;
    z-index: 0;
    inset: 22px;
    border: 1px dashed var(--color-border);
    border-radius: 18px;
    content: "";
    pointer-events: none;
}

.dropzone > :not(.visually-hidden) {
    position: relative;
    z-index: 1;
}

.dropzone p:first-of-type {
    margin: 0 0 8px;
    font-size: 19px;
    letter-spacing: -.02em;
}

.dropzone .btn { margin-top: 24px; }

.dropzone-hint {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 13px;
}

.dropzone.is-over {
    border-color: var(--color-link);
    box-shadow: 0 18px 42px color-mix(in srgb, var(--color-link) 12%, transparent);
}

.dropzone.is-over::after { border-color: var(--color-link); }
.dropzone.is-over .dropzone-icon { background-color: color-mix(in srgb, var(--color-link) 18%, var(--color-surface)); }

.tool-note {
    max-width: 880px;
    margin: 20px auto 0;
    padding-inline: 20px;
    color: var(--color-text-muted);
    font-size: 13px;
    line-height: 1.75;
    text-align: center;
}

.tool-note p { margin: 0; }
.tool-note strong { color: var(--color-text); }

.document-note {
    margin-bottom: 18px;
    color: var(--color-text-muted);
    font-size: 13px;
}

.document-note p { margin: 0; }

.tool-workspace { margin-top: 28px; }

.tool-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    min-height: 62px;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
}

.tool-bar .filename {
    min-width: 0;
    overflow: hidden;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tool-bar .spacer { flex: 1 1 auto; }

.tool-status {
    min-height: 25px;
    margin: 12px 0;
    color: var(--color-text-muted);
    font-size: 13px;
}

/* ==========================================================================
   7. 편집기 · 뷰어 · 변환 결과
   ========================================================================== */
.editor-shell {
    height: min(78vh, 900px);
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    box-shadow: var(--shadow);
}

.editor-workspace .editor-shell {
    border-radius: 0 0 var(--radius) var(--radius);
}

.editor-workspace .tool-bar {
    border-bottom: 0;
    border-radius: var(--radius) var(--radius) 0 0;
}

.editor-shell iframe { display: block; width: 100%; height: 100%; border: 0; }

html.is-editor-open {
    overflow: hidden;
    scrollbar-gutter: auto;
}

body.is-editor-open { overflow: hidden; }
.edit-page.is-editor-open { background: var(--color-bg); }

.edit-page.is-editor-open .editor-workspace {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    background: var(--color-surface);
}

.edit-page.is-editor-open .editor-toolbar {
    flex: 0 0 auto;
    min-height: 68px;
    padding: 8px 16px;
    border: 0;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    background: var(--color-surface);
    flex-wrap: nowrap;
}

.editor-file-meta {
    display: grid;
    grid-template-columns: minmax(0, auto) auto minmax(120px, 1fr);
    align-items: center;
    gap: 2px 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.edit-page.is-editor-open .editor-file-meta .filename {
    max-width: min(36vw, 560px);
    color: var(--color-text);
}

.editor-status {
    min-width: 0;
    overflow: hidden;
    color: var(--color-text-muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-compat {
    grid-column: 1 / -1;
    overflow: hidden;
    color: var(--color-text-muted);
    font-size: 11px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.edit-page.is-editor-open .editor-shell {
    flex: 1 1 auto;
    width: 100%;
    height: auto;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.edit-page.is-editor-open #alert:not([hidden]) {
    position: fixed;
    top: 68px;
    left: 0;
    z-index: 120;
    width: 100%;
    margin: 0;
    padding: 12px 16px;
    background: var(--color-surface);
    box-shadow: var(--shadow-strong);
}

.viewer-controls {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
}

.viewer-search,
.pager,
.page-jump {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.viewer-search .count,
.pager .count { color: var(--color-text-muted); font-size: 13px; }

.viewer-input,
.viewer-page-input {
    min-height: 42px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-small);
    background: var(--color-bg);
    color: var(--color-text);
}

.viewer-input {
    flex: 1 1 260px;
    min-width: 180px;
    padding: 8px 13px;
}

.viewer-page-input {
    width: 70px;
    padding: 8px 8px 8px 12px;
    text-align: right;
}

.page-jump { margin-left: auto; }

.viewer-stage {
    min-height: 180px;
    padding: 24px;
    overflow: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
}

.viewer-stage svg {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.conversion-panel {
    display: grid;
    gap: 22px;
    margin-bottom: 20px;
    padding: 24px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--color-text);
    border-bottom: 1px solid var(--color-border);
}

.metric-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.metric {
    min-width: 0;
    padding: 18px 16px;
    border-right: 1px solid var(--color-border);
}

.metric:first-child { padding-left: 0; }
.metric:last-child { padding-right: 0; border-right: 0; }

.metric-label,
.metric-value {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-label { color: var(--color-text-muted); font-size: 11px; font-weight: 650; }
.metric-value { margin-top: 6px; font-size: 20px; letter-spacing: -.025em; }

.converter-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.converter-actions .dropzone-hint { flex: 1 1 auto; }

.converter-preview {
    max-height: 680px;
    background: var(--color-track);
}

.converter-preview svg {
    max-width: min(100%, 800px);
    box-shadow: var(--shadow);
}

.print-surface {
    position: fixed;
    inset: 0;
    z-index: -1;
    width: 100vw;
    height: 100vh;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

/* ==========================================================================
   8. 문서형 페이지
   ========================================================================== */
.tool-documentation {
    margin-top: 80px;
    padding: 0;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}

.doc {
    max-width: calc(var(--reading) + 48px);
    padding-top: 68px;
    padding-bottom: 76px;
}

.doc > h1 { margin-bottom: 18px; }
.doc > .lead { margin-bottom: 46px; }

.doc h2 {
    margin-top: 46px;
    margin-bottom: 14px;
    padding-top: 22px;
    border-top: 1px solid var(--color-border);
    font-size: 22px;
}

.doc .lead + h2 { margin-top: 0; }
.doc h3 { margin-top: 28px; margin-bottom: 10px; font-size: 17px; }
.doc p { color: color-mix(in srgb, var(--color-text) 88%, var(--color-text-muted)); }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin-bottom: 7px; }
.doc a { font-weight: 600; }

.doc table {
    display: block;
    width: 100%;
    margin: 22px 0 26px;
    overflow-x: auto;
    border-top: 1px solid var(--color-text);
    border-collapse: collapse;
    font-size: 14px;
}

.doc tbody { display: table; width: 100%; }

.doc th,
.doc td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.doc th {
    width: 150px;
    background: color-mix(in srgb, var(--color-text) 3%, transparent);
    font-weight: 700;
}

.doc pre {
    max-width: 100%;
    padding: 18px;
    overflow: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-small);
    background: var(--color-bg);
}

.log-year {
    margin-top: 44px;
    padding: 0;
    border: 0;
    font-family: var(--font-mono);
    font-size: 16px;
}

.log-item {
    display: grid;
    grid-template-columns: 108px 64px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    padding: 20px 0;
    border-top: 1px solid var(--color-border);
}

.log-item:last-child { border-bottom: 1px solid var(--color-border); }
.log-item time { padding-top: 2px; color: var(--color-text-muted); font-family: var(--font-mono); font-size: 12px; }
.log-item h3 { margin: 0 0 5px; font-size: 16px; }
.log-item p { margin: 0; color: var(--color-text-muted); font-size: 14px; }

/* ==========================================================================
   9. 오류 화면
   ========================================================================== */
.errorpage {
    display: grid;
    place-items: center;
    min-height: 72vh;
    padding: 64px 24px;
    text-align: center;
}

.errorpage .code {
    margin-bottom: 14px;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .12em;
}

.errorpage h1 { margin-bottom: 16px; font-size: clamp(30px, 4vw, 44px); }
.errorpage p { max-width: 480px; margin-inline: auto; color: var(--color-text-muted); }

/* ==========================================================================
   10. 반응형
   ========================================================================== */
@media (max-width: 920px) {
    :root { --section-y: 64px; }

    .hero { padding: 72px 0 64px; }
    .hero-grid { grid-template-columns: 1fr; align-items: start; gap: 52px; }
    .hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); }
    .hero-facts div { display: block; padding: 15px 16px; border-right: 1px solid var(--color-border); }
    .hero-facts div:last-child { border-right: 0; }
    .hero-facts dd { margin-top: 4px; text-align: left; }

    .features { grid-template-columns: 1fr; }

    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .footer-meta { justify-self: start; }
    .footer-nav { justify-content: flex-start; }
    .footer-updated { text-align: left; }
}

@media (max-width: 720px) {
    :root { --header-h: 62px; --section-y: 54px; }

    .wrap { padding-inline: 18px; }
    .header-inner { gap: 18px; }
    .site-nav { gap: 15px; }
    .site-nav a { font-size: 13px; }

    .hero { padding: 56px 0 50px; }
    .hero h1 { font-size: clamp(40px, 12vw, 58px); }
    .hero-grid { gap: 42px; }

    .section-intro { grid-template-columns: 1fr; gap: 12px; margin-bottom: 26px; }
    .section-intro p { justify-self: start; }

    .tool-entry { grid-template-columns: 38px minmax(0, 1fr); gap: 14px; padding: 24px 0; }
    .tool-link { grid-column: 2; justify-self: start; margin-top: 6px; }

    .support-grid { grid-template-columns: 1fr; }
    .support-block { padding: 24px 0; }
    .support-block + .support-block { padding-left: 0; border-top: 1px solid var(--color-border); border-left: 0; }
    .status-list { grid-template-columns: 1fr; }

    .tool-head { padding-top: 42px; padding-bottom: 22px; }

    .dropzone {
        min-height: 320px;
        padding: 64px 36px 54px;
        border-radius: 22px;
    }

    .dropzone::after { inset: 16px; border-radius: 15px; }

    .metric-grid,
    .metric-grid-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric:nth-child(2n) { padding-right: 0; border-right: 0; }
    .metric:nth-child(2n + 1) { padding-left: 0; }
    .metric:nth-child(n + 3) { border-top: 1px solid var(--color-border); }

    .converter-actions { align-items: stretch; flex-direction: column; }
    .converter-actions .btn { width: 100%; }

    .viewer-search .viewer-input { flex-basis: 100%; }
    .page-jump { width: 100%; margin-left: 0; }
    .viewer-stage { padding: 14px; }

    .doc { padding-top: 52px; padding-bottom: 58px; }
    .tool-documentation { margin-top: 60px; }
    .log-item { grid-template-columns: auto 1fr; gap: 7px 12px; }
    .log-item > div { grid-column: 1 / -1; }

    .footer-bottom { align-items: flex-start; flex-direction: column; gap: 18px; }

    .editor-shell { height: min(70vh, 640px); }
    .edit-page.is-editor-open .editor-toolbar {
        align-items: stretch;
        min-height: 112px;
        padding: 8px;
        flex-wrap: wrap;
    }
    .edit-page.is-editor-open .editor-file-meta {
        flex-basis: 100%;
        grid-template-columns: minmax(0, 1fr) auto;
    }
    .edit-page.is-editor-open .editor-status { display: none; }
    .edit-page.is-editor-open .editor-file-meta .filename { max-width: none; }
    .edit-page.is-editor-open .editor-actions { width: 100%; justify-content: flex-end; }
    .edit-page.is-editor-open #alert:not([hidden]) { top: 120px; }
}

@media (max-width: 520px) {
    .brand-name { display: none; }
    .site-nav { flex: 1 1 auto; justify-content: space-between; gap: 8px; }

    .hero-facts { grid-template-columns: 1fr; }
    .hero-facts div { display: grid; grid-template-columns: 1fr 1fr; border-right: 0; }
    .hero-facts dd { margin-top: 0; text-align: right; }

    .btn-row { align-items: stretch; flex-direction: column; }
    .btn-row .btn { width: 100%; }

    .dropzone {
        min-height: 300px;
        padding: 58px 28px 48px;
        border-radius: 18px;
    }

    .dropzone-icon { width: 62px; height: 62px; margin-bottom: 18px; border-radius: 17px; }
    .dropzone-icon svg { width: 30px; height: 30px; }
    .dropzone::after { inset: 12px; border-radius: 13px; }
    .dropzone p:first-of-type { font-size: 17px; }
    .dropzone .btn { width: min(100%, 240px); margin-top: 20px; }
    .tool-note { padding-inline: 8px; }

    .metric-grid,
    .metric-grid-three { grid-template-columns: 1fr; }
    .metric,
    .metric:first-child,
    .metric:nth-child(2n),
    .metric:nth-child(2n + 1) {
        padding: 14px 0;
        border-top: 1px solid var(--color-border);
        border-right: 0;
    }
    .metric:first-child { border-top: 0; }

    .viewer-search .btn { flex: 1 1 auto; }
    .pager > .btn { flex: 1 1 0; }
    .page-jump { flex-wrap: nowrap; }

    .doc th { width: 116px; }
    .footer-nav { display: grid; grid-template-columns: repeat(2, 1fr); }

    .edit-page.is-editor-open .editor-actions { display: grid; grid-template-columns: 1fr 1fr auto; }
    .edit-page.is-editor-open .editor-actions .btn { padding-inline: 10px; }
}
