/* Commercial admin edit/delete actions use the item-list palette on every page,
   including dialogs that are appended outside the page content. */
body.catx-on {
    --catx-action-edit: #2e7d32;
    --catx-action-edit-hover: #eaf6ec;
    --catx-action-delete: #c62828;
    --catx-action-delete-hover: #fceaea;
    --catx-action-restore: #2563eb;
    --catx-action-restore-hover: #eaf0fb;
}

/* The body arm includes dynamically inserted dialogs; the ID arm keeps this
   stylesheet above older page-specific !important button declarations. */
body.catx-on:is(#admin_wrap, body) :is(
    .btn_edit, .edit_btn, .edit_btns, .btn_edit_move, .btn_edit_timeline,
    #btn_edit_timeline, .btn-reply-edit, .cx-mbtn-edit,
    button[title="수정"], a[title="수정"], span[title="수정"], div[title="수정"]
) {
    color: var(--catx-action-edit) !important;
    border-color: var(--catx-action-edit) !important;
    background-color: #fff !important;
}

body.catx-on:is(#admin_wrap, body) :is(
    .btn_remove, .new_removeBtn, .btn_delete, .delete_btn, .btn-delete,
    .btn_remove_url, .remove_btn, .file_delete_btn, .real_file_del_btn,
    .select_btn_del, .group_btn_delete, .fav_del_btn, .del_scrap_btn,
    .land_unit_btn_remove, .building_unit_btn_remove, .cx-mbtn-del,
    button[title="삭제"], a[title="삭제"], span[title="삭제"], div[title="삭제"]
) {
    color: var(--catx-action-delete) !important;
    border-color: var(--catx-action-delete) !important;
    background-color: #fff !important;
}

body.catx-on:is(#admin_wrap, body) :is(
    .btn_edit, .edit_btn, .edit_btns, .btn_edit_move, .btn_edit_timeline,
    #btn_edit_timeline, .btn-reply-edit, .cx-mbtn-edit,
    button[title="수정"], a[title="수정"], span[title="수정"], div[title="수정"]
):is(:hover, :focus-visible) {
    color: var(--catx-action-edit) !important;
    border-color: var(--catx-action-edit) !important;
    background-color: var(--catx-action-edit-hover) !important;
}

body.catx-on:is(#admin_wrap, body) :is(
    .btn_remove, .new_removeBtn, .btn_delete, .delete_btn, .btn-delete,
    .btn_remove_url, .remove_btn, .file_delete_btn, .real_file_del_btn,
    .select_btn_del, .group_btn_delete, .fav_del_btn, .del_scrap_btn,
    .land_unit_btn_remove, .building_unit_btn_remove, .cx-mbtn-del,
    button[title="삭제"], a[title="삭제"], span[title="삭제"], div[title="삭제"]
):is(:hover, :focus-visible) {
    color: var(--catx-action-delete) !important;
    border-color: var(--catx-action-delete) !important;
    background-color: var(--catx-action-delete-hover) !important;
}

body.catx-on:is(#admin_wrap, body) :is(
    .btn_edit, .edit_btn, .edit_btns, .btn_edit_move, .btn_edit_timeline,
    #btn_edit_timeline, .btn-reply-edit, .cx-mbtn-edit,
    .btn_remove, .new_removeBtn, .btn_delete, .delete_btn, .btn-delete,
    .btn_remove_url, .remove_btn, .file_delete_btn, .real_file_del_btn,
    .select_btn_del, .group_btn_delete, .fav_del_btn, .del_scrap_btn,
    .land_unit_btn_remove, .building_unit_btn_remove, .cx-mbtn-del,
    button[title="수정"], a[title="수정"], span[title="수정"], div[title="수정"],
    button[title="삭제"], a[title="삭제"], span[title="삭제"], div[title="삭제"]
) :is(i, svg, span, strong, p) {
    color: inherit !important;
}

body.catx-on:is(#admin_wrap, body) :is(
    .btn_edit, .edit_btn, .edit_btns, .btn_edit_move, .btn_edit_timeline,
    #btn_edit_timeline, .btn-reply-edit, .cx-mbtn-edit,
    .btn_remove, .new_removeBtn, .btn_delete, .delete_btn, .btn-delete,
    .btn_remove_url, .remove_btn, .file_delete_btn, .real_file_del_btn,
    .select_btn_del, .group_btn_delete, .fav_del_btn, .del_scrap_btn,
    .land_unit_btn_remove, .building_unit_btn_remove, .cx-mbtn-del,
    button[title="수정"], a[title="수정"], span[title="수정"], div[title="수정"],
    button[title="삭제"], a[title="삭제"], span[title="삭제"], div[title="삭제"]
) svg [stroke]:not([stroke="none"]) {
    stroke: currentColor !important;
}

/* Less common controls use the same actions outside the standard list tables. */
body.catx-on:is(#admin_wrap, body) :is(.cx-medit, .editMemoBtn, .xl_etc_edit, .rp_edit) {
    color: var(--catx-action-edit) !important;
    border-color: var(--catx-action-edit) !important;
    background-color: #fff !important;
}
body.catx-on:is(#admin_wrap, body) :is(.cx-medit, .editMemoBtn, .xl_etc_edit, .rp_edit):is(:hover, :focus-visible) {
    background-color: var(--catx-action-edit-hover) !important;
}
body.catx-on:is(#admin_wrap, body) :is(
    .owner_delete, .fileRemove_btn, .btn_remove_file, .btn_file_del,
    .btn_delete_image, .delete_btns, .del_btn, .dd-delete, .gc-delete,
    .reply_remove, .xl_etc_del
) {
    color: var(--catx-action-delete) !important;
    border-color: var(--catx-action-delete) !important;
    background-color: #fff !important;
}
body.catx-on:is(#admin_wrap, body) :is(
    .owner_delete, .fileRemove_btn, .btn_remove_file, .btn_file_del,
    .btn_delete_image, .delete_btns, .del_btn, .dd-delete, .gc-delete,
    .reply_remove, .xl_etc_del
):is(:hover, :focus-visible) {
    background-color: var(--catx-action-delete-hover) !important;
}
body.catx-on:is(#admin_wrap, body) :is(
    .cx-medit, .editMemoBtn, .xl_etc_edit, .rp_edit, .owner_delete,
    .fileRemove_btn, .btn_remove_file, .btn_file_del, .btn_delete_image,
    .delete_btns, .del_btn, .dd-delete, .gc-delete, .reply_remove, .xl_etc_del
) :is(i, svg, span, strong, p) {
    color: inherit !important;
}

/* Restore is blue even where older markup reuses edit or delete classes. */
body.catx-on:is(#admin_wrap, body) :is(
    #btn_restore, .btn_restore, .xl_etc_restore, .use_expiration_btn,
    .restore_modal_btn_1, .restore_modal_btn_2,
    button[title="복구"], a[title="복구"], span[title="복구"], div[title="복구"]
) {
    color: var(--catx-action-restore) !important;
    border-color: var(--catx-action-restore) !important;
    background-color: #fff !important;
}
body.catx-on:is(#admin_wrap, body) :is(
    #btn_restore, .btn_restore, .xl_etc_restore, .use_expiration_btn,
    .restore_modal_btn_1, .restore_modal_btn_2,
    button[title="복구"], a[title="복구"], span[title="복구"], div[title="복구"]
):is(:hover, :focus-visible) {
    color: var(--catx-action-restore) !important;
    border-color: var(--catx-action-restore) !important;
    background-color: var(--catx-action-restore-hover) !important;
}
body.catx-on:is(#admin_wrap, body) :is(
    #btn_restore, .btn_restore, .xl_etc_restore, .use_expiration_btn,
    .restore_modal_btn_1, .restore_modal_btn_2,
    button[title="복구"], a[title="복구"], span[title="복구"], div[title="복구"]
) :is(i, svg, span, strong, p) {
    color: inherit !important;
}
body.catx-on:is(#admin_wrap, body) :is(
    #btn_restore, .btn_restore, .xl_etc_restore, .use_expiration_btn,
    .restore_modal_btn_1, .restore_modal_btn_2,
    button[title="복구"], a[title="복구"], span[title="복구"], div[title="복구"]
) svg [stroke]:not([stroke="none"]) {
    stroke: currentColor !important;
}
body.catx-on:is(#admin_wrap, body) :is(#btn_restore, .cx-mbtn-edit[title="복구"]) .cx-ic,
body.catx-on:is(#admin_wrap, body) :is(#btn_restore, .cx-mbtn-edit[title="복구"]) .cx-ic path {
    stroke: var(--catx-action-restore) !important;
}
