.board-editor-form {
    --ink: #20252a;
    --muted: #6c737a;
    --line: #e2e5e8;
    --blue: #1769aa;
    --soft: #f3f7fb;
    display: grid;
    width: 100%;
    max-width: none;
    gap: 16px;
    margin-top: 22px;
    color: var(--ink);
}

.board-editor-form,
.board-editor-form * {
    box-sizing: border-box;
}

.board-editor-form .editor-field {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.board-editor-form .editor-field > input,
.board-editor-form .editor-field > select,
.board-editor-form .editor-field > textarea {
    width: 100%;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.board-editor-form .editor-field > small {
    color: var(--muted);
    font-size: 12px;
}

.board-editor-form .editor-actions .button {
    padding: 10px 14px;
    border: 0;
    background: var(--blue);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
}

.board-editor-form .editor-actions .link {
    color: var(--blue);
}

.post-edit-page .editor-form,
.post-write-page .editor-form {
    width: 100%;
    max-width: none;
}

.admin-writer-page .editor-form {
    max-width: 820px;
}

.feature-type-field {
    margin: 0;
    padding: 14px;
    border: 1px solid var(--line);
}

.feature-type-title {
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

.feature-type-help {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
}

.feature-type-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
}

.feature-type-options label {
    display: flex !important;
    align-items: center;
    gap: 6px;
    color: var(--ink);
    font-weight: 400;
}

.feature-type-options input[type="radio"],
.board-radio-options input[type="radio"] {
    display: inline-block;
    width: 16px !important;
    height: 16px;
    margin: 0;
    padding: 0;
    accent-color: var(--blue);
}

.board-radio-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.board-radio-options label {
    display: flex !important;
    align-items: center;
    gap: 7px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-weight: 400;
    cursor: pointer;
}

.board-radio-options label:has(input:checked) {
    border-color: var(--blue);
    background: #eaf3fa;
    color: var(--blue);
    font-weight: 700;
}

.editor-label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.editor-panel {
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #fff;
}

.editor-panel .editor {
    width: 100%;
    min-width: 0;
    min-height: 360px;
    padding: 24px;
    border: 0;
    border-top: 1px solid var(--line);
    outline: 0;
    background: #fff;
    font-size: 17px;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.editor-panel .editor:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(23, 105, 170, .18);
}

.editor-panel .editor p:first-child {
    margin-top: 0;
}

.editor-panel .editor:empty::before {
    color: #9aa4ad;
    content: '본문을 입력하세요';
    pointer-events: none;
}

.editor-tools.editor-tools-floating {
    position: fixed;
    left: 50%;
    bottom: 22px;
    z-index: 1000;
    display: flex;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    width: min(calc(100vw - 28px), 920px);
    min-height: 64px;
    max-height: min(88px, calc(100vh - 20px));
    transform: translateX(-50%);
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px 10px;
    border: 1px solid rgba(23, 105, 170, .25);
    border-radius: 12px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 10px 30px rgba(32, 61, 83, .18);
    backdrop-filter: blur(12px);
    scrollbar-width: thin;
}

.editor-toolbar-group {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
}

.editor-tools-floating .editor-tool-button {
    display: inline-grid;
    flex: 0 0 36px;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #263640;
    cursor: pointer;
    font: inherit;
    font-size: 16px;
    font-weight: 650;
    line-height: 1;
}

.editor-tools-floating .editor-tool-button:hover,
.editor-tools-floating .editor-tool-button:focus-visible {
    border-color: #b8d0df;
    background: #edf5fa;
    color: #125d91;
    outline: none;
}

.editor-tools-floating .editor-tool-button[aria-pressed="true"] {
    border-color: #b8d0df;
    background: #e4f0f7;
    color: #125d91;
}

.editor-tools-floating .editor-tool-button:disabled {
    cursor: not-allowed;
    opacity: .4;
}

.editor-icon {
    display: block;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.editor-toolbar-separator {
    width: 1px;
    height: 25px;
    flex: 0 0 1px;
    margin: 0 5px;
    background: #dce3e8;
}

.editor-tools-floating .editor-size-control {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    color: #5c6871;
    font-size: 12px;
    font-weight: 650;
}

.editor-size-control select {
    height: 34px;
    padding: 0 7px;
    border: 1px solid #dce3e8;
    border-radius: 6px;
    background: #fff;
    color: #263640;
    font: inherit;
}

.editor-tools-floating .editor-color-control {
    position: relative;
    display: inline-grid !important;
    flex: 0 0 36px;
    place-items: center;
    width: 36px;
    height: 36px;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #263640 !important;
    cursor: pointer;
}

.editor-color-control:hover {
    background: #edf5fa;
}

.editor-color-control input {
    position: absolute;
    right: 5px;
    bottom: 4px;
    width: 25px !important;
    height: 4px;
    margin: 0;
    padding: 0 !important;
    border: 0 !important;
    opacity: 1;
    cursor: pointer;
}

.editor-toolbar-status {
    min-width: 70px;
    margin-left: 6px;
    color: #6c737a;
    font-size: 11px;
    white-space: nowrap;
}

.editor-image-figure {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin: 18px auto;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    text-align: center;
}

.editor-image-figure img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.editor-image-figure figcaption {
    min-height: 1.5em;
    margin-top: 7px;
    color: #6c737a;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

.editor-image-figure figcaption:empty::before {
    color: #9aa4ad;
    content: '이미지 설명';
}

.editor-image-figure.is-selected {
    border-color: #1769aa;
    background: #f5fafe;
}

.editor-youtube {
    margin: 12px 0;
    padding: 12px;
    border: 1px solid #d7e4ed;
    background: #f3f7fb;
    color: #6c737a;
    font-size: 13px;
}

.editor-choice-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    margin: 0;
    padding: 12px 16px 12px 13px;
    border: 1px solid #d7e3ea;
    border-radius: 8px;
    background: linear-gradient(110deg, #f2f8fb, #fff);
    color: #17384b;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(29, 75, 99, .08);
}

.editor-choice-option:hover,
.editor-choice-option:has(input:checked),
.editor-ai-option:hover,
.editor-ai-option:has(input:checked) {
    border-color: #1674a8;
    box-shadow: 0 8px 22px rgba(22, 116, 168, .16);
}

.editor-choice-option input,
.editor-ai-option input {
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    border: 0;
    accent-color: #1674a8;
}

.editor-choice-mark {
    display: grid;
    place-items: center;
    min-width: 35px;
    height: 35px;
    border-radius: 7px;
    background: #1674a8;
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    line-height: 1.05;
    text-align: center;
}

.editor-choice-copy,
.editor-ai-copy {
    display: grid;
    gap: 2px;
}

.editor-choice-copy strong {
    font-size: 14px;
}

.editor-choice-copy small,
.editor-ai-option small {
    color: #6c737a;
    font-size: 11px;
}

.editor-ai-option {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 13px;
    border: 1px solid #d7e3ea;
    border-radius: 8px;
    background: linear-gradient(110deg, #f1f8f5, #fff);
    color: #17384b;
    cursor: pointer;
}

.editor-feature-checks {
    display: grid;
    grid-template-columns: minmax(250px, 1.35fr) minmax(220px, 1.2fr) repeat(3, minmax(105px, .7fr));
    flex-basis: 100%;
    gap: 12px;
    width: 100%;
}

.editor-feature-checks > label {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.editor-placeholder-option {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-width: 0;
    min-height: 60px;
    padding: 10px;
    border: 1px dashed #cdd5da;
    border-radius: 8px;
    background: #fafcfd;
    color: #75818a;
    cursor: not-allowed;
}

.editor-placeholder-option input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #9aa7af;
}

.editor-placeholder-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.editor-placeholder-copy strong {
    font-size: 12px;
    white-space: nowrap;
}

.editor-placeholder-copy small {
    color: #8d989f;
    font-size: 10px;
}

.editor-ai-mark {
    display: grid !important;
    place-items: center;
    width: 35px;
    height: 35px;
    flex: 0 0 35px;
    border-radius: 7px;
    background: #34785e;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.admin-feature-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
}

.admin-feature-options > .feature-type-title,
.admin-feature-options > .feature-type-help {
    flex-basis: 100%;
}

.admin-feature-options > .feature-type-options {
    display: contents;
}

.admin-feature-options > .editor-choice-option {
    flex: 0 1 auto;
}

.admin-feature-options > .editor-feature-checks {
    flex-basis: 100%;
}

.admin-writer-page .editor-form {
    max-width: 820px;
}

.admin-writer-page .admin-board-choice,
.admin-writer-page .admin-feature-options {
    display: grid !important;
    padding: 16px;
    border: 1px solid #c8d9e6;
    background: #f3f7fb;
}

.admin-writer-page .admin-board-choice { order: 0; }
.admin-writer-page .admin-feature-options { order: 1; }
.admin-writer-page .editor-title-field { order: 2; }
.admin-writer-page .editor-subtitle-field { order: 3; }
.admin-writer-page .editor-body-field { order: 4; }
.admin-writer-page .attachment-field { order: 5; }
.admin-writer-page .editor-actions { order: 6; }
.admin-writer-page .admin-board-choice > small {
    color: #6c737a;
    font-size: 12px;
    font-weight: 400;
}

.editor-panel {
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #fff;
}

.editor {
    min-height: 260px;
    padding: 14px;
    border: 1px solid var(--line);
    line-height: 1.7;
}

.editor-image-figure.is-selected::after {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 4px 7px;
    border-radius: 4px;
    background: #1769aa;
    color: #fff;
    content: '선택됨';
    font-size: 11px;
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.editor-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 8px;
    background: var(--soft);
}

.editor-tools button {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.editor-tools button:hover,
.editor-tools button:focus-visible {
    border-color: var(--blue);
    color: var(--blue);
}

.editor-divider {
    width: 1px;
    height: 22px;
    margin: 0 3px;
    background: var(--line);
}

.editor-size-control {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.editor-size-control select {
    height: 32px;
    border: 1px solid var(--line);
    background: #fff;
    font: inherit;
}

.editor-panel .editor {
    width: 100%;
    min-width: 0;
    border: 0;
    border-top: 1px solid var(--line);
    outline: 0;
    background: #fff;
}

.board-editor-form .editor-panel .editor {
    min-height: 360px;
    padding: 24px;
    font-size: 17px;
    line-height: 1.85;
}

.editor-youtube {
    margin: 12px 0;
    padding: 12px;
    border: 1px solid #d7e4ed;
    background: var(--soft);
    color: var(--muted);
    font-size: 13px;
}

.attachment-field {
    padding: 15px;
    border: 1px dashed #b9c9d6;
    background: var(--soft);
}

.attachment-field input {
    padding: 9px;
    background: #fff;
}

.attachment-field small {
    color: var(--muted);
    font-size: 12px;
}

.attachment-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.attachment-preview-item {
    position: relative;
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 9px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 12px;
}

.attachment-preview-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.attachment-preview-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-remove {
    justify-self: start;
    padding: 3px 7px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
}

.attachment-remove:hover {
    border-color: #b85c5c;
    color: #b85c5c;
}

@media (max-width: 880px) {
    .editor-feature-checks {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .editor-feature-checks {
        grid-template-columns: 1fr;
    }

    .editor-tools.editor-tools-floating {
        bottom: 10px;
        justify-content: flex-start;
        width: calc(100vw - 20px);
        border-radius: 10px;
    }

    .editor-tools-floating + .editor {
        min-height: 280px;
        padding: 18px;
        padding-bottom: 78px;
    }

    .editor-toolbar-status {
        display: none;
    }

}

@media (prefers-reduced-motion: no-preference) {
    .editor-tools-floating,
    .editor-panel .editor {
        transition: box-shadow .18s ease, background-color .18s ease;
    }
}
