.cello-campaign-widget {
    position: relative;
    width: 322px;
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
    color: #111827;
    font-family: 'Arimo', 'Noto Sans KR', sans-serif;
    overflow: visible;
}

.cello-campaign-widget--fixed {
    position: fixed;
    right: 6rem;
    bottom: 10rem;
    z-index: 10010;
    max-height: calc(100vh - 10rem - 120px);
    max-height: calc(100dvh - 10rem - 120px);
}

.cello-campaign-inner {
    max-height: inherit;
    border-radius: 16px;
    overflow: auto;
    overscroll-behavior: contain;
    background: #ffffff;
}

.cello-campaign-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(17, 24, 39, 0.58);
    color: #ffffff;
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.2);
    transition: background 0.2s ease, transform 0.2s ease;
}

.cello-campaign-close:hover {
    background: rgba(17, 24, 39, 0.78);
    transform: translateY(-1px);
}

.cello-campaign-media {
    display: block;
    width: 100%;
    background: #eff6ff;
    line-height: 0;
}

.cello-campaign-media img {
    display: block;
    width: 100%;
    max-height: 330px;
    object-fit: cover;
}

.cello-campaign-body {
    padding: 17px 18px 18px;
}

.cello-campaign-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 18px;
    color: #6b7280;
}

.cello-campaign-meta strong {
    color: #0f172a;
    font-weight: 800;
}

.cello-campaign-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef233c;
}

.cello-campaign-text {
    font-size: 14px;
    line-height: 1.78;
    color: #111827;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.cello-campaign-text p,
.cello-campaign-text div {
    margin: 0;
}

.cello-campaign-text p:last-child,
.cello-campaign-text div:last-child {
    margin-bottom: 0;
}

.cello-campaign-text ul,
.cello-campaign-text ol {
    margin: 0 0 0 18px !important;
    padding-left: 18px !important;
}

.cello-campaign-text li {
    display: list-item !important;
    margin: 0;
    padding-left: 2px;
    line-height: 1.78;
}

.cello-campaign-text ul {
    list-style: none !important;
}

.cello-campaign-text ol {
    list-style: decimal outside !important;
}

.cello-campaign-text ul > li {
    position: relative;
    list-style: none !important;
    padding-left: 16px;
}

.cello-campaign-text ul > li::before {
    content: "";
    position: absolute;
    top: 0.78em;
    left: 1px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ef233c;
}

.cello-campaign-text ol > li {
    list-style-type: decimal !important;
}

.cello-campaign-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin-top: 12px;
    padding: 7px 12px;
    border-radius: 8px;
    background: #e8f3ff;
    color: #1683e8;
    font-size: 13px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.cello-campaign-link:hover {
    background: #d8ebff;
    color: #006bd6;
    transform: translateY(-1px);
}

.marketing-admin-area {
    min-height: calc(100vh - 64px);
    padding-bottom: 96px;
    background: #f5f7fb;
}

.marketing-admin-shell {
    display: grid;
    grid-template-columns: minmax(360px, 480px) minmax(420px, 1fr);
    gap: 22px;
    padding: 28px;
}

.marketing-editor-panel,
.marketing-preview-panel,
.marketing-list-panel {
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(30, 41, 59, 0.08);
}

.marketing-editor-panel {
    padding: 22px;
}

.marketing-preview-panel {
    display: flex;
    flex-direction: column;
    min-height: 620px;
}

.marketing-list-panel {
    grid-column: 1 / -1;
    padding: 22px;
}

.marketing-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.marketing-panel-head h2 {
    margin: 0;
    color: #172033;
    font-size: 20px;
    font-weight: 800;
    line-height: 28px;
    letter-spacing: 0;
}

.marketing-panel-head p {
    margin: 4px 0 0;
    color: #667085;
    font-size: 13px;
    line-height: 20px;
}

.marketing-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.marketing-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.marketing-toggle span {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #cfd8e3;
    transition: background 0.2s ease;
}

.marketing-toggle span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
    transition: transform 0.2s ease;
}

.marketing-toggle input:checked + span {
    background: #0d47ff;
}

.marketing-toggle input:checked + span::after {
    transform: translateX(18px);
}

.marketing-toggle b {
    color: #24364b;
    font-size: 13px;
    line-height: 20px;
}

.marketing-field {
    margin-top: 18px;
}

.marketing-title-input {
    width: 100%;
    height: 42px;
    padding: 9px 12px;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    color: #111827;
    font-size: 15px;
    line-height: 20px;
    box-sizing: border-box;
}

.marketing-title-input:focus {
    border-color: #0d47ff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 71, 255, 0.12);
}

.marketing-label {
    display: block;
    margin-bottom: 8px;
    color: #1f2937;
    font-size: 14px;
    font-weight: 800;
    line-height: 20px;
}

.marketing-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.marketing-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #d6dee8;
    border-radius: 8px;
    background: #ffffff;
    color: #344054;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.marketing-tool-btn:hover,
.marketing-tool-btn:focus {
    border-color: #0d47ff;
    background: #f0f5ff;
    color: #0d47ff;
}

.marketing-link-tool {
    font-size: 13px;
}

.marketing-emoji-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 8px;
    padding: 8px;
    border: 1px solid #d6dee8;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.marketing-emoji-picker[hidden] {
    display: none;
}

.marketing-emoji-picker button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: #f4f7fb;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.16s ease, transform 0.16s ease;
}

.marketing-emoji-picker button:hover,
.marketing-emoji-picker button:focus {
    background: #e8f3ff;
    transform: translateY(-1px);
}

.marketing-editor {
    min-height: 186px;
    max-height: 320px;
    padding: 14px;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    background: #ffffff;
    color: #111827;
    font-size: 15px;
    line-height: 1.78;
    outline: none;
    overflow-y: auto;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.marketing-editor p,
.marketing-editor div {
    margin: 0;
}

.marketing-editor ul,
.marketing-editor ol {
    margin: 0 0 0 18px !important;
    padding-left: 18px !important;
}

.marketing-editor ul {
    list-style: none !important;
}

.marketing-editor ol {
    list-style: decimal outside !important;
}

.marketing-editor li {
    display: list-item !important;
    margin: 0;
    padding-left: 2px;
    line-height: 1.78;
}

.marketing-editor ul > li {
    position: relative;
    list-style: none !important;
    padding-left: 16px;
}

.marketing-editor ul > li::before {
    content: "";
    position: absolute;
    top: 0.78em;
    left: 1px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ef233c;
}

.marketing-editor ol > li {
    list-style-type: decimal !important;
}

.marketing-editor:focus {
    border-color: #0d47ff;
    box-shadow: 0 0 0 3px rgba(13, 71, 255, 0.12);
}

.marketing-editor:empty::before {
    content: "메시지를 입력하세요";
    color: #98a2b3;
}

.marketing-link-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    margin-top: 10px;
    padding: 8px 10px;
    border: 1px solid #d8eaff;
    border-radius: 8px;
    background: #f0f7ff;
}

.marketing-link-chip[hidden] {
    display: none;
}

.marketing-link-chip a {
    max-width: 300px;
    color: #1683e8;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.marketing-link-chip button {
    border: 0;
    background: transparent;
    color: #667085;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.marketing-image-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.marketing-secondary-btn,
.marketing-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    line-height: 18px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.marketing-secondary-btn {
    border: 1px solid #d6dee8;
    background: #ffffff;
    color: #344054;
}

.marketing-secondary-btn:hover {
    border-color: #aeb9c7;
    background: #f8fafc;
}

.marketing-primary-btn {
    border: 1px solid #0d47ff;
    background: #0d47ff;
    color: #ffffff;
}

.marketing-primary-btn:hover {
    background: #0039dd;
    transform: translateY(-1px);
}

.marketing-file-name {
    min-height: 20px;
    margin: 8px 0 0;
    color: #667085;
    font-size: 13px;
    line-height: 20px;
    word-break: break-all;
}

.marketing-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #edf1f7;
}

.marketing-save-status {
    flex: 1;
    min-height: 20px;
    margin: 0;
    color: #1683e8;
    font-size: 13px;
    font-weight: 700;
    line-height: 20px;
}

.marketing-save-status.error {
    color: #dc2626;
}

.marketing-preview-panel .marketing-panel-head {
    margin: 0;
    padding: 22px 22px 0;
}

.marketing-preview-stage {
    position: relative;
    flex: 1;
    min-height: 520px;
    margin-top: 18px;
    border-top: 1px solid #edf1f7;
    background:
        linear-gradient(90deg, rgba(148, 163, 184, 0.16) 1px, transparent 1px),
        linear-gradient(180deg, rgba(148, 163, 184, 0.16) 1px, transparent 1px),
        #f8fafc;
    background-size: 22px 22px;
}

.marketing-preview-stage .cello-campaign-widget {
    position: absolute;
    right: 28px;
    bottom: 28px;
}

.marketing-preview-empty {
    position: absolute;
    right: 28px;
    bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 322px;
    height: 180px;
    max-width: calc(100% - 56px);
    border: 1px dashed #b9c5d5;
    border-radius: 8px;
    color: #8a97a8;
    font-size: 14px;
    font-weight: 700;
}

.marketing-table-wrap {
    overflow-x: auto;
}

.marketing-campaign-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    color: #1f2937;
    font-size: 14px;
}

.marketing-campaign-table th,
.marketing-campaign-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #edf1f7;
    text-align: left;
    vertical-align: middle;
    line-height: 20px;
}

.marketing-campaign-table th {
    background: #f8fafc;
    color: #475467;
    font-size: 12px;
    font-weight: 800;
}

.marketing-campaign-table tbody tr {
    cursor: pointer;
    transition: background 0.16s ease;
}

.marketing-campaign-table tbody tr:hover,
.marketing-campaign-table tbody tr.active {
    background: #f0f6ff;
}

.marketing-campaign-title-cell {
    max-width: 360px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.marketing-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #eef2f7;
    color: #667085;
    font-size: 12px;
    font-weight: 800;
}

.marketing-status-badge.is-enabled {
    background: #e8f3ff;
    color: #1683e8;
}

.marketing-empty-row {
    color: #8a97a8;
    text-align: center !important;
    cursor: default;
}

.marketing-link-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.42);
}

.marketing-link-modal[hidden] {
    display: none;
}

.marketing-link-dialog {
    width: 360px;
    max-width: 100%;
    padding: 20px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.marketing-link-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.marketing-link-dialog h3 {
    margin: 0;
    color: #172033;
    font-size: 18px;
    font-weight: 800;
    line-height: 26px;
}

.marketing-link-dialog-head button {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: #eef2f7;
    color: #4b5563;
    font-size: 22px;
    line-height: 30px;
    cursor: pointer;
}

.marketing-link-dialog label {
    display: block;
    margin: 12px 0 6px;
    color: #344054;
    font-size: 13px;
    font-weight: 800;
}

.marketing-link-dialog input {
    width: 100%;
    height: 40px;
    padding: 8px 10px;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    color: #111827;
    font-size: 14px;
    box-sizing: border-box;
}

.marketing-link-dialog input:focus {
    border-color: #0d47ff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 71, 255, 0.12);
}

.marketing-link-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

@media (max-width: 1199px) {
    .cello-campaign-widget--fixed {
        right: 1rem;
        bottom: 7rem;
        max-height: calc(100vh - 7rem - 96px);
        max-height: calc(100dvh - 7rem - 96px);
    }
}

@media (max-width: 1024px) {
    .marketing-admin-shell {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .marketing-preview-panel {
        min-height: 540px;
    }
}

@media (max-width: 768px) {
    .cello-campaign-widget--fixed {
        right: 1rem;
        bottom: 6.5rem;
        max-height: calc(100vh - 6.5rem - 80px);
        max-height: calc(100dvh - 6.5rem - 80px);
    }

    .cello-campaign-body {
        padding: 15px 16px 16px;
    }

    .marketing-admin-shell {
        padding: 14px;
    }

    .marketing-editor-panel {
        padding: 16px;
    }

    .marketing-panel-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .marketing-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .marketing-primary-btn,
    .marketing-secondary-btn {
        width: 100%;
    }

    .marketing-preview-stage .cello-campaign-widget,
    .marketing-preview-empty {
        right: 16px;
        bottom: 16px;
    }
}
