.distribution {
    --ink: #111;
    --line: #d6d6d6;
    --soft: #f4f4f4;
    --muted: #707070;
    max-width: 1320px;
    margin: 0 auto;
    padding: 48px 28px 120px;
    color: var(--ink);
    font: 16px/1.6 Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.distribution-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 0 0 28px;
    border-bottom: 1px solid var(--ink);
}

.distribution-hero h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1;
    letter-spacing: -.04em;
}

.distribution-hero button,
.distribution .solid {
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid #111;
    color: #fff;
    background: #111;
    font-weight: 700;
}

.distribution-filter {
    display: flex;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
}

.distribution-filter button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid transparent;
    color: var(--muted);
    background: #fff;
    font-weight: 700;
}

.distribution-filter button.active { color: #fff; background: #111; }
.distribution-filter button small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border: 1px solid #ccc;
    border-radius: 10px;
    color: #666;
    font-size: 11px;
}
.distribution-filter button.active small { border-color: #fff; color: #111; background: #fff; }

.distribution-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 18px 0;
}

.distribution-controls { display: flex; align-items: center; gap: 8px; }
.distribution-search { position: relative; display: block; width: min(520px, 52vw); }
.distribution-search svg {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #555;
    stroke-width: 2;
    transform: translateY(-50%);
    pointer-events: none;
}
.distribution-toolbar .distribution-search input {
    width: 100%;
    min-height: 44px;
    padding: 0 14px 0 42px;
    border: 1px solid #aaa;
    background: #fff;
}
.distribution-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 10px;
    border: 1px solid #aaa;
    background: #fff;
}
.distribution-sort span { color: #666; font-size: 12px; }
.distribution-sort select { min-height: 40px; border: 0; background: #fff; font: inherit; font-weight: 700; }

.distribution-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px; }
.distribution-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(190px, 42%) 1fr;
    height: 270px;
    border: 1px solid var(--line);
    background: #fff;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background-color .16s ease;
}
.distribution-card:hover,
.distribution-card:focus-within {
    border-color: #111;
    background: #fdfdfd;
    box-shadow: 0 14px 30px rgba(0, 0, 0, .075);
    transform: translateY(-2px);
}
.distribution-card:focus-within { outline: 1px solid #111; outline-offset: 3px; }
.distribution-card-hit { position: absolute; inset: 0; z-index: 1; }
.card-preview {
    display: block;
    width: 100%;
    min-height: 100%;
    padding: 0;
    border: 0;
    border-right: 1px solid var(--line);
    background: #eee;
    overflow: hidden;
}
.card-preview img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease, filter .25s ease; }
.distribution-card:hover .card-preview img,
.distribution-card:focus-within .card-preview img { filter: saturate(.96) contrast(1.02); transform: scale(1.012); }
.distribution-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    min-height: 270px;
    background: repeating-linear-gradient(135deg, #eee 0, #eee 12px, #f8f8f8 12px, #f8f8f8 24px);
}
.distribution-placeholder span {
    padding: 8px 12px;
    color: #fff;
    background: #111;
    font: 800 13px ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: .1em;
}
.card-body { display: flex; min-width: 0; flex-direction: column; padding: 20px; }
.card-body header { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
.card-body header > span { font-weight: 800; }
.card-body h2 { margin: 17px 0 8px; font-size: 21px; line-height: 1.25; letter-spacing: -.025em; }
.card-body p {
    display: -webkit-box;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.method { padding: 3px 6px; color: #fff; background: #111; }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.tag-list span { font-size: 11px; color: #555; }
.card-body footer { position: relative; z-index: 2; display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 18px; }
.card-body footer button {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #111;
    background: #fff;
    color: #111;
    font-weight: 700;
    font-size: 13px;
}
.card-body footer .solid { min-height: 38px; color: #fff; background: #111; }
.distribution-empty { grid-column: 1 / -1; padding: 90px 20px; border: 1px dashed #aaa; color: var(--muted); text-align: center; }

.distribution-editor {
    max-width: none;
    padding: 0;
    border: 1px solid #111;
    background: #fff;
    box-shadow: 10px 10px 0 rgba(0, 0, 0, .12);
}
.distribution-editor::backdrop { background: rgba(255, 255, 255, .88); }

.distribution-detail {
    width: 100%;
    background: #fff;
}
.distribution-detail[hidden] { display: none; }
.distribution.is-detail > .distribution-hero,
.distribution.is-detail > .distribution-filter,
.distribution.is-detail > .distribution-toolbar,
.distribution.is-detail > .distribution-list { display: none; }
.distribution-detail-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 0 16px;
    border-bottom: 1px solid #111;
}
.distribution-detail-nav button {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid #111;
    background: #fff;
    color: #111;
    font-weight: 700;
}
.distribution-detail-actions { display: flex; align-items: center; gap: 8px; }
.distribution-detail-nav .distribution-detail-edit { color: #fff; background: #111; }
.distribution-post-head { padding: 46px clamp(0px, 5vw, 58px) 38px; border-bottom: 1px solid #111; }
.distribution-post-head > span { font: 700 11px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .1em; }
.distribution-post-head time { float: right; color: #777; font-size: 12px; }
.distribution-post-head h2 { max-width: 820px; margin: 14px 0 10px; font-size: clamp(30px, 5vw, 52px); line-height: 1.12; letter-spacing: -.045em; }
.distribution-post-head > p { max-width: 720px; margin: 0; color: #666; font-size: 15px; }
.distribution-post-cover { margin: 0; padding: 40px clamp(0px, 5vw, 58px) 0; }
.distribution-post-cover img { display: block; width: 100%; max-height: 680px; object-fit: contain; background: #f3f3f3; }
.distribution-post-body {
    width: min(820px, calc(100% - 48px));
    min-height: 240px;
    margin: 0 auto;
    padding: 56px 0 70px;
    color: #222;
    font-size: 16px;
    line-height: 1.85;
}
.distribution-post-body > :first-child { margin-top: 0; }
.distribution-post-body > :last-child { margin-bottom: 0; }
.distribution-post-body img { max-width: 100%; height: auto; }
.distribution-inline-media { margin: 32px 0; text-align: center; }
.distribution-inline-media img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.distribution-inline-media figcaption { margin-top: 8px; color: #777; font-size: 12px; }
.distribution-primary-link { display: block; width: min(820px, calc(100% - 48px)); margin: -30px auto 50px; padding: 15px 18px; border: 1px solid #111; color: #fff; background: #111; text-align: center; text-decoration: none; font-weight: 700; }
.distribution-unlock {
    width: min(820px, calc(100% - 48px));
    margin: 0 auto 64px;
    padding: 24px;
    border: 1px solid #111;
    background: #f4f4f4;
}
.distribution-unlock > div > span { color: #666; font: 700 11px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; }
.distribution-unlock h3 { margin: 5px 0 18px; font-size: 18px; }
.distribution-unlock form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.distribution-unlock input { width: 100%; min-height: 44px; padding: 0 13px; border: 1px solid #999; background: #fff; color: #111; font: inherit; }
.distribution-unlock button { min-width: 74px; border: 1px solid #111; color: #fff; background: #111; font-weight: 700; }
.distribution-unlock button:disabled { opacity: .55; }
.distribution-unlock-status { min-height: 20px; margin: 9px 0 0; color: #8a1717; font-size: 13px; }
.distribution-protected-result { margin-top: 24px; border-top: 1px solid #111; }
.distribution-protected-result > header { padding: 14px clamp(24px, 5vw, 58px); color: #fff; background: #111; }
.distribution-protected-result > header h3 { margin: 0; color: #fff; font-size: 15px; }
.distribution-protected-body { width: min(820px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 60px; font-size: 16px; line-height: 1.85; }
.distribution-protected-body img { max-width: 100%; height: auto; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.distribution-downloads,
.distribution-sheet-workspace { padding: 38px clamp(0px, 3vw, 34px); border-top: 1px solid #ccc; }
.distribution-downloads h3 { margin: 0 0 16px; font-size: 18px; }
.distribution-downloads > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.distribution-downloads a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px; border: 1px solid #bbb; color: #111; text-decoration: none; }
.distribution-sheet-workspace { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(290px, .8fr); align-items: start; gap: 14px; }
.distribution-sheet-visual,
.distribution-code-panel { min-width: 0; border: 1px solid #111; background: #fff; }
.distribution-sheet-visual > header,
.distribution-code-panel > header { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px 6px 14px; color: #fff; background: #111; }
.distribution-sheet-visual h3,
.distribution-code-panel h4 { margin: 0; color: #fff; font: 700 12px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; }
.distribution-sheet-visual > div { min-height: 260px; background: #f4f4f4; }
.distribution-sheet-visual figure { margin: 0; }
.distribution-sheet-visual img { display: block; width: 100%; height: auto; }
.distribution-sheet-visual figcaption { padding: 9px 12px; color: #666; background: #fff; font-size: 12px; }
.distribution-sheet-image-empty { display: grid; min-height: 260px; place-items: center; color: #777; }
.distribution-sheet-code-stack { display: grid; gap: 14px; }
.distribution-copy-action { position: relative; display: inline-flex; flex: none; }
.distribution-code-panel button { min-width: 54px; min-height: 30px; padding: 0 11px; border: 0; color: #111; background: #fff; font-size: 12px; font-weight: 800; }
.distribution-copy-action > button.copied,
.distribution-code-panel button.copied,
.distribution-article-code > header button.copied {
    color: #fff;
    border-color: #111;
    background: #111;
}
.distribution-copy-action > button.copy-failed,
.distribution-code-panel button.copy-failed,
.distribution-article-code > header button.copy-failed {
    color: #111;
    border-color: #111;
    background: #fff;
}
.distribution-copy-feedback {
    position: absolute;
    right: 0;
    bottom: calc(100% + 9px);
    z-index: 5;
    width: max-content;
    padding: 8px 10px;
    border: 1px solid #111;
    color: #fff;
    background: #111;
    box-shadow: 0 9px 20px rgba(0, 0, 0, .14);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .14s ease, transform .14s ease;
}
.distribution-copy-feedback::after {
    content: '';
    position: absolute;
    right: 18px;
    bottom: -5px;
    width: 8px;
    height: 8px;
    border-right: 1px solid #111;
    border-bottom: 1px solid #111;
    background: #111;
    transform: rotate(45deg);
}
.distribution-copy-feedback[data-visible="true"] { opacity: 1; transform: none; }
.distribution-code-panel pre { height: 320px; margin: 0; padding: 15px; overflow: auto; border: 0; background: #f3f3f3; color: #222; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; }
.distribution-article-code { min-width: 0; margin: 26px 0; border: 1px solid #111; background: #fff; }
.distribution-article-code > header { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px 6px 14px; color: #fff; background: #111; }
.distribution-article-code > header b { font: 700 12px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; }
.distribution-article-code > header button { min-width: 54px; min-height: 30px; padding: 0 11px; border: 0; color: #111; background: #fff; font-size: 12px; font-weight: 800; }
.distribution-article-code > pre { position: static !important; display: block !important; float: none !important; box-sizing: border-box; width: 100% !important; max-width: 100% !important; min-width: 0 !important; margin: 0 !important; padding: 16px !important; overflow: auto !important; border: 0 !important; border-radius: 0 !important; background: #f3f3f3 !important; color: #222 !important; text-align: left !important; white-space: pre !important; transform: none !important; }
.distribution-article-code > pre code { display: block !important; min-width: max-content; padding: 0 !important; border: 0 !important; background: transparent !important; color: inherit !important; font: 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace !important; white-space: pre !important; }

.distribution-editor {
    position: fixed;
    inset: 0;
    width: min(1200px, calc(100vw - 64px));
    height: min(860px, calc(100dvh - 64px));
    max-height: calc(100dvh - 64px);
    margin: auto;
    overflow: auto;
}
.distribution-editor form { min-height: 100%; color: #111; background: #fff; font: 14px/1.5 Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.distribution-editor-head {
    position: sticky;
    z-index: 60;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 76px;
    padding: 12px 24px;
    border-bottom: 1px solid #111;
    background: rgba(255, 255, 255, .97);
}
.distribution-editor-head small { color: #777; font: 700 10px ui-monospace, Consolas, monospace; letter-spacing: .12em; }
.distribution-editor-head h2 { margin: 1px 0 0; font-size: 22px; }
.editor-head-actions,
.editor-actions { display: flex; gap: 8px; }
.editor-head-actions button,
.editor-actions button { min-height: 42px; padding: 0 16px; border: 1px solid #111; background: #fff; font-weight: 700; }
.editor-head-actions .solid,
.editor-actions .solid { color: #fff; background: #111; }
.distribution-editor-body { display: grid; grid-template-columns: minmax(0, 1fr) 330px; align-items: start; }
.distribution-editor-main { min-width: 0; padding: 28px; border-right: 1px solid #ccc; }
.distribution-editor-side { min-width: 0; }
.distribution-editor-side > section { display: grid; gap: 14px; padding: 20px; border-bottom: 1px solid #ccc; }
.distribution-editor-side h3 { margin: 0; font-size: 14px; }
.distribution-editor label { display: grid; gap: 6px; color: #222; font-size: 13px; font-weight: 700; }
.distribution-editor label > small { color: #777; font-size: 11px; font-weight: 400; }
.distribution-editor input,
.distribution-editor select,
.distribution-editor textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #aaa; border-radius: 0; background: #fff; color: #111; font: inherit; }
.distribution-editor textarea { resize: vertical; }
.distribution-editor [hidden] { display: none !important; }
.editor-title-field { margin-bottom: 18px; }
.editor-title-field input { min-height: 58px; padding: 7px 0; border-width: 0 0 2px; font-size: 28px; font-weight: 800; letter-spacing: -.025em; }
.editor-title-field + label { margin-bottom: 22px; }
.distribution-content-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; font-size: 13px; font-weight: 700; }
.distribution-content-heading button { min-height: 38px; padding: 0 12px; border: 1px solid #111; background: #fff; font-weight: 700; }
.distribution-content-heading button i { margin-right: 5px; }
.distribution-rich-editor,
.distribution-rich-editor .ra0-editor-wrapper { width: 100%; max-width: 100%; min-width: 0; }
.distribution-rich-editor,
.distribution-rich-editor * { box-sizing: border-box; }
.distribution-rich-editor .ra0-editor-wrapper { border-color: #aaa; border-radius: 0; --gray-900: #111; --container-bg-color: #fff; --content-font-color: #222; }
.distribution-rich-editor .ra0-editor-toolbar { position: sticky; z-index: 45; top: 76px; border-radius: 0; }
.distribution-rich-editor .ra0-editor-viewer { box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; min-height: 590px !important; max-height: none; padding: 34px clamp(20px, 5vw, 54px); overflow-x: auto !important; overflow-y: auto; overscroll-behavior: contain; background: #fff; color: #222; font-size: 16px; line-height: 1.8; }
.distribution-rich-editor .ra0-editor-viewer pre { position: static !important; inset: auto !important; display: block !important; float: none !important; box-sizing: border-box; width: 100% !important; max-width: 100% !important; min-width: 0 !important; margin: 1em 0 !important; overflow: auto !important; text-align: left !important; white-space: pre !important; transform: none !important; }
.distribution-rich-editor .ra0-editor-viewer pre code { display: block !important; min-width: max-content; max-width: none; white-space: pre !important; word-break: normal !important; overflow-wrap: normal !important; }
.distribution-rich-editor .ra0-editor-source { min-height: 590px; max-height: none; border-radius: 0; }
.distribution-rich-editor .distribution-inline-media { outline: 1px dashed #aaa; outline-offset: 5px; }
.distribution-protected-editor { margin-top: 34px; padding-top: 28px; border-top: 2px solid #111; }
.distribution-protected-editor .distribution-content-heading { margin-bottom: 12px; }
.distribution-password-settings .editor-checkbox { display: flex; align-items: flex-start; gap: 9px; }
.distribution-password-settings .editor-checkbox input { width: 18px; min-height: 18px; margin: 2px 0 0; accent-color: #111; }
.distribution-password-settings .editor-checkbox span { line-height: 1.45; }
.distribution-editor [data-current-code] { display: block; min-height: 17px; color: #555; }
.current-code-preview { border: 1px solid #bbb; background: #f4f4f4; }
.current-code-preview summary { padding: 9px 11px; cursor: pointer; font-size: 12px; font-weight: 700; }
.current-code-preview pre { max-height: 190px; margin: 0; padding: 11px; overflow: auto; border-top: 1px solid #ccc; color: #222; background: #fff; font: 11px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.existing-attachments { display: grid; gap: 6px; }
.existing-file { display: flex !important; align-items: center; justify-content: space-between; gap: 8px !important; padding: 8px 0; border-top: 1px solid #ddd; font-weight: 400 !important; }
.existing-file span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.existing-file input { width: auto; min-height: 0; margin-left: auto; }
.editor-danger button { min-height: 40px; border: 0; color: #9d1111; background: transparent; text-align: left; font-weight: 700; }
.distribution-editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; border-top: 1px solid #111; }
.form-status { min-height: 20px; margin: 0; color: #555; }

@media (max-width: 900px) {
    .distribution-list { grid-template-columns: 1fr; }
    .distribution-sheet-workspace { grid-template-columns: 1fr; }
    .distribution-editor-body { grid-template-columns: 1fr; }
    .distribution-editor-main { border-right: 0; border-bottom: 1px solid #111; }
    .distribution-rich-editor .ra0-editor-toolbar { position: relative; top: auto; }
}

@media (max-width: 600px) {
    .distribution { padding: 26px 14px 100px; font-size: 15px; }
    .distribution-hero { align-items: stretch; flex-direction: column; }
    .distribution-hero h1 { font-size: 34px; }
    .distribution-controls { align-items: stretch; flex-direction: column; width: 100%; }
    .distribution-search { width: 100%; }
    .distribution-sort { justify-content: space-between; }
    .distribution-sort select { flex: 1; }
    .distribution-card { grid-template-columns: 1fr; height: auto; }
    .card-preview { height: 210px; border-right: 0; border-bottom: 1px solid var(--line); }
    .distribution-placeholder { min-height: 210px; }
    .card-body { min-height: 230px; }
    .distribution-editor { inset: 0; width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; box-shadow: none; }
    .distribution-post-head { padding: 34px 4px 28px; }
    .distribution-post-head time { float: none; display: block; margin: 6px 0 0; }
    .distribution-post-cover { padding: 24px 14px 0; }
    .distribution-post-body { width: calc(100% - 36px); padding: 36px 0 50px; font-size: 15px; }
    .distribution-unlock { width: 100%; margin-bottom: 42px; padding: 18px; }
    .distribution-unlock form { grid-template-columns: 1fr; }
    .distribution-unlock button { min-height: 42px; }
    .distribution-protected-result > header { padding: 13px 16px; }
    .distribution-protected-body { width: calc(100% - 36px); padding: 36px 0 46px; font-size: 15px; }
    .distribution-downloads,
    .distribution-sheet-workspace { padding: 28px 0; }
    .distribution-downloads > div { grid-template-columns: 1fr; }
    .distribution-code-panel pre { height: 260px; }
    .distribution-editor-head { min-height: 66px; padding: 10px 14px; }
    .distribution-editor-head small { display: none; }
    .distribution-editor-head h2 { font-size: 18px; }
    .editor-head-actions button { min-height: 38px; padding: 0 12px; }
    .distribution-editor-main { padding: 20px 14px; }
    .editor-title-field input { font-size: 23px; }
    .distribution-rich-editor .ra0-editor-viewer { min-height: 470px !important; padding: 22px 16px; font-size: 15px; }
    .distribution-rich-editor .toolbar-btn-wide { min-width: 34px; padding: 4px 7px; }
    .distribution-rich-editor .toolbar-btn-wide .btn-text { display: none; }
    .editor-grid { grid-template-columns: 1fr; }
    .distribution-editor-foot { padding: 12px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .card-preview img { transition: none; }
}
