.document-viewer-page {
    min-height: 100vh;
    background: #f5f7fa;
    color: #141824;
    font-family: "PublpageNotoSansKR", "Noto Sans KR", "Segoe UI", system-ui, sans-serif;
    padding: 34px 18px;
}

.document-viewer-message {
    width: min(920px, 100%);
    margin: 0 auto;
    border: 1px solid #e3e6ed;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

.document-viewer {
    margin: 0 auto;
    border: 1px solid #e3e6ed;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

.document-viewer.width-70 {
    width: min(70vw, 1120px);
}

.document-viewer.width-80 {
    width: min(80vw, 1280px);
}

.document-viewer.width-90 {
    width: min(90vw, 1440px);
}

.document-viewer.width-100 {
    width: min(100%, calc(100vw - 36px));
}

.document-viewer-header {
    position: relative;
    border-bottom: 1px solid #e3e6ed;
    padding: 14px 18px 12px;
}

.document-viewer-title-block {
    min-width: 0;
}

.document-viewer-logo-link {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    text-decoration: none;
}

.document-viewer-logo-link img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.document-viewer-compact-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
}

.document-viewer-heading-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
}

.document-viewer-heading-side {
    display: grid;
    justify-items: end;
    gap: 5px;
}

.file-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 22px;
    border: 1px solid transparent;
    border-radius: 7px;
    padding: 0 8px;
    font-size: 10px;
    font-weight: 950;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
}

.file-type-markdown {
    background: #edf4ff;
    border-color: #c6dbff;
    color: #315fc4;
}

.file-type-html,
.file-ext-html,
.file-ext-htm {
    background: #fff3e8;
    border-color: #ffd7b8;
    color: #b45309;
}

.file-type-code,
.file-ext-cs,
.file-ext-razor,
.file-ext-cshtml {
    background: #eef5ff;
    border-color: #bdd5ff;
    color: #1d4ed8;
}

.file-type-script,
.file-ext-js,
.file-ext-mjs,
.file-ext-cjs,
.file-ext-jsx,
.file-ext-ts,
.file-ext-tsx {
    background: #fff8db;
    border-color: #fde68a;
    color: #9a6700;
}

.file-type-style,
.file-ext-css,
.file-ext-scss,
.file-ext-sass {
    background: #f1efff;
    border-color: #d7ceff;
    color: #5b4dc4;
}

.file-type-data,
.file-ext-json,
.file-ext-xml,
.file-ext-xaml,
.file-ext-yml,
.file-ext-yaml,
.file-ext-sql,
.file-ext-csv {
    background: #e9fbf5;
    border-color: #b8ebda;
    color: #047864;
}

.file-type-pdf,
.file-ext-pdf {
    background: #fff0f0;
    border-color: #ffc7c7;
    color: #c24141;
}

.file-type-document,
.file-ext-doc,
.file-ext-docx,
.file-ext-txt {
    background: #eef6ff;
    border-color: #c7defa;
    color: #2563a8;
}

.file-type-sheet,
.file-ext-xls,
.file-ext-xlsx {
    background: #ecfdf3;
    border-color: #bdeccf;
    color: #167348;
}

.file-type-slide,
.file-ext-ppt,
.file-ext-pptx {
    background: #fff4e6;
    border-color: #ffd7a8;
    color: #af5f00;
}

.file-type-image,
.file-ext-png,
.file-ext-jpg,
.file-ext-jpeg,
.file-ext-gif,
.file-ext-svg,
.file-ext-webp {
    background: #f7efff;
    border-color: #dfc7ff;
    color: #7e3fb8;
}

.file-type-media {
    background: #fff0f8;
    border-color: #ffc8e4;
    color: #ad3b78;
}

.file-type-archive,
.file-type-font,
.file-type-executable,
.file-type-default {
    background: #f5f7fb;
    border-color: #d8dee9;
    color: #596579;
}

.document-viewer-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 0;
}

.document-viewer-header h1 {
    min-width: 0;
    margin: 0;
    color: #141824;
    font-size: 21px;
    line-height: 1.25;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-viewer-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.document-viewer-copy-url {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #3874ff;
    cursor: pointer;
}

.document-viewer-copy-url:hover {
    background: #f5f7ff;
}

.document-viewer-copy-url i {
    font-size: 13px;
}

.document-viewer-clone,
.document-viewer-branch {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-height: 24px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #2563eb;
    padding: 0;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.document-viewer-clone span,
.document-viewer-branch span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.document-viewer-clone i,
.document-viewer-branch i {
    font-size: 13px;
}

.document-viewer-clone:hover,
.document-viewer-branch:hover {
    background: #f5f7ff;
}

.document-viewer-clone:disabled,
.document-viewer-branch:disabled {
    cursor: wait;
    opacity: 0.68;
}

.document-viewer-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 10px;
}

.document-viewer-meta-row {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 5px 9px;
    margin: 0;
}

.document-viewer-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #6e7891;
    font-size: 11px;
    font-weight: 800;
}

.document-viewer-meta-item i {
    color: #3874ff;
    font-size: 11px;
}

.document-viewer-lineage-row {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

.document-viewer-lineage {
    min-height: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: min(100%, 520px);
    border: 1px solid #d7dde8;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    padding: 0 7px;
    font-size: 11px;
    font-weight: 900;
}

.document-viewer-lineage i {
    color: #3874ff;
    font-size: 13px;
}

.document-viewer-lineage a,
.document-viewer-lineage > span:not(.document-viewer-lineage-revision) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-viewer-lineage a {
    color: #2563eb;
    text-decoration: none;
}

.document-viewer-lineage a:hover {
    text-decoration: underline;
}

.document-viewer-lineage-revision {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 11px;
}

.document-viewer-lineage-branch {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.document-viewer-lineage-branch i,
.document-viewer-lineage-branch a {
    color: #15803d;
}

.document-viewer-branch-summary {
    min-height: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    background: #f0fdf4;
    color: #166534;
    padding: 0 7px;
    font-size: 11px;
    font-weight: 900;
}

.document-viewer-branch-summary i {
    color: #15803d;
    font-size: 13px;
}

.document-viewer-clone-summary {
    min-height: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    padding: 0 7px;
    font-size: 11px;
    font-weight: 900;
}

.document-viewer-clone-summary i {
    color: #2563eb;
    font-size: 13px;
}

.document-viewer-like {
    min-height: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #6e7891;
    padding: 0 3px;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
}

.document-viewer-like:hover {
    background: #fff5f9;
    color: #be185d;
}

.document-viewer-like.liked {
    background: #fff5f9;
    color: #be185d;
}

.document-viewer-like i {
    color: currentColor;
    font-size: 11px;
}

.document-viewer-like:disabled {
    cursor: wait;
    opacity: 0.68;
}

.document-viewer-like-message,
.document-viewer-copy-message {
    margin: 8px 0 0;
    color: #be123c;
    font-size: 12px;
    font-weight: 800;
}

.document-viewer-copy-message,
.document-viewer-clone-message,
.document-viewer-branch-message {
    color: #2563eb;
}

.document-preview-header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.document-preview-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    border: 1px solid #d7dde8;
    border-radius: 6px;
    background: #f8fafc;
    color: #31374a;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.document-preview-back:hover {
    border-color: #9eb8ff;
    background: #eff4ff;
    color: #1d4ed8;
}

.document-viewer-body {
    padding: 28px;
    color: #1f2937;
    font-size: 16px;
    line-height: 1.76;
}

.document-viewer-frame-wrap {
    padding: 18px;
}

.document-viewer-frame {
    width: 100%;
    min-height: 760px;
    border: 1px solid #e3e6ed;
    border-radius: 8px;
    background: #fff;
}

.document-viewer-body h1,
.document-viewer-body h2,
.document-viewer-body h3,
.document-viewer-body h4 {
    color: #111827;
    line-height: 1.25;
    font-weight: 900;
}

.document-viewer-body h1 {
    font-size: 28px;
}

.document-viewer-body h2 {
    margin-top: 32px;
    font-size: 23px;
}

.document-viewer-body h3 {
    margin-top: 26px;
    font-size: 19px;
}

.document-viewer-body p {
    margin: 0 0 16px;
}

.document-viewer-body a {
    color: #2563eb;
    font-weight: 800;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.document-viewer-body ul,
.document-viewer-body ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.document-viewer-body li {
    margin: 4px 0;
}

.document-viewer-body li > p {
    margin: 0;
}

.document-viewer-body input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0 7px 0 -20px;
    vertical-align: -2px;
    accent-color: #2563eb;
}

.document-viewer-body blockquote {
    margin: 18px 0;
    border-left: 4px solid #bfdbfe;
    background: #f8fbff;
    color: #475569;
    padding: 12px 16px;
}

.document-viewer-body blockquote > :last-child {
    margin-bottom: 0;
}

.document-viewer-body hr {
    border: 0;
    border-top: 1px solid #e3e6ed;
    margin: 28px 0;
}

.document-viewer-body .katex-display {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 0;
}

.document-viewer-body .katex {
    font-size: 1.02em;
}

.document-viewer-body img {
    max-width: 100%;
    height: auto;
}

.document-viewer-body table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 18px 0;
}

.document-viewer-body th,
.document-viewer-body td {
    border: 1px solid #e3e6ed;
    padding: 8px 10px;
}

.document-viewer-body th {
    background: #f8fafc;
    color: #31374a;
    font-weight: 900;
}

.document-viewer-body pre {
    overflow-x: auto;
    border: 1px solid #e3e6ed;
    border-radius: 8px;
    background: #0f172a;
    color: #e5e7eb;
    padding: 14px;
    margin: 18px 0;
}

.document-viewer-body .mermaid {
    overflow-x: auto;
    border: 1px solid #e3e6ed;
    border-radius: 8px;
    background: #f8fbff;
    color: #334155;
    padding: 16px;
    margin: 18px 0;
    text-align: center;
}

.document-viewer-body .mermaid svg {
    max-width: 100%;
    height: auto;
}

.document-viewer-body .mermaid-error {
    border-color: #fecaca;
    background: #fff1f2;
    color: #b91c1c;
    text-align: left;
}

.document-viewer-body code {
    border-radius: 5px;
    background: #f1f5f9;
    color: #0f172a;
    padding: 2px 5px;
    font-size: 0.92em;
}

.document-viewer-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.document-viewer-body .pp-code-highlighted {
    background: #111827;
    color: #dbeafe;
}

.document-viewer-body .pp-code-with-lines {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.document-viewer-body .pp-code-with-lines code {
    display: block;
    min-width: max-content;
}

.document-viewer-body .pp-code-line-numbers {
    min-width: 28px;
    border-right: 1px solid rgba(148, 163, 184, 0.28);
    color: #64748b;
    padding-right: 12px;
    text-align: right;
    user-select: none;
    white-space: pre;
}

.document-viewer-body .pp-code-token.keyword {
    color: #93c5fd;
}

.document-viewer-body .pp-code-token.type {
    color: #67e8f9;
}

.document-viewer-body .pp-code-token.string {
    color: #86efac;
}

.document-viewer-body .pp-code-token.number {
    color: #fbbf24;
}

.document-viewer-body .pp-code-token.comment {
    color: #94a3b8;
    font-style: italic;
}

.document-viewer-body .pp-code-token.attribute,
.document-viewer-body .pp-code-token.property {
    color: #f9a8d4;
}

.document-viewer-body .pp-code-token.punctuation {
    color: #c4b5fd;
}

.document-viewer-message {
    display: grid;
    gap: 8px;
    justify-items: center;
    padding: 54px 24px;
    text-align: center;
}

.document-viewer-message h1 {
    margin: 0;
    color: #141824;
    font-size: 24px;
    font-weight: 900;
}

.document-viewer-message p {
    margin: 0;
    color: #6e7891;
    font-size: 14px;
    font-weight: 800;
}

.document-viewer-password-form {
    width: min(360px, 100%);
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.document-viewer-password-form label {
    display: grid;
    gap: 7px;
    color: #56627a;
    font-size: 12px;
    font-weight: 900;
    text-align: left;
}

.document-viewer-password-form input {
    width: 100%;
    height: 42px;
    border: 1px solid #d8deea;
    border-radius: 8px;
    padding: 0 12px;
    color: #141824;
    font: 800 14px/1.2 "PublpageNotoSansKR", "Noto Sans KR", "Segoe UI", system-ui, sans-serif;
}

.document-viewer-password-form button {
    height: 42px;
    border: 0;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font: 900 13px/1 "PublpageNotoSansKR", "Noto Sans KR", "Segoe UI", system-ui, sans-serif;
}

.document-viewer-password-form button:disabled {
    opacity: 0.62;
}

.document-viewer-password-message {
    color: #dc2626 !important;
}

@media (max-width: 840px) {
    .document-viewer.width-70,
    .document-viewer.width-80,
    .document-viewer.width-90,
    .document-viewer.width-100 {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .document-viewer-page {
        padding: 14px;
    }

    .document-viewer-body {
        padding: 20px;
    }

    .document-viewer-header {
        padding: 14px;
    }

    .document-viewer-header h1 {
        font-size: 18px;
    }

    .document-viewer-compact-header {
        grid-template-columns: minmax(0, 1fr);
        gap: 9px;
    }

    .document-viewer-heading-side {
        justify-items: start;
    }
}
