:root {
    --cd-bg-top: #fcfaf7;
    --cd-bg-bottom: #f5f1eb;
    --cd-card: #ffffff;
    --cd-card-soft: #fcfbf8;
    --cd-border: #e2dbd0;
    --cd-border-strong: #d1c9bb;
    --cd-text: #2a2520;
    --cd-text-muted: #7a7068;
    --cd-primary: #0a5439;
    --cd-primary-soft: #e0efe8;
    --cd-danger: #c34a4a;
    --cd-success: #2d9565;
    --cd-shadow: 0 14px 30px rgba(80, 60, 30, 0.1);
}

* {
    box-sizing: border-box;
}

body.cd-page {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--cd-bg-top), var(--cd-bg-bottom));
    color: var(--cd-text);
    font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
}

.cd-container {
    width: min(1640px, 100%);
    margin: 0 auto;
    padding: 12px 14px 52px;
}

.cd-title-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.cd-top-bar {
    position: absolute;
    right: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
}

.cd-header-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cd-title {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.cd-title-center {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0;
}

.cd-title-icon {
    height: 1.8em;
    width: auto;
    vertical-align: middle;
    margin-left: 4px;
}

.cd-subtitle {
    margin: 0;
    color: var(--cd-text-muted);
    font-size: 0.95rem;
}

.cd-welcome-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 18px 0;
}

.cd-welcome-message {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--cd-text-muted);
    margin: 0;
}

.cd-sns-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    margin-bottom: 8px;
}

.cd-sns-btn {
    display: block;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.cd-sns-btn:hover {
    transform: scale(1.12);
    opacity: 0.85;
}

.cd-quick-links {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 22px;
}

.cd-quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: transform 0.15s ease;
}

.cd-quick-link:hover {
    transform: translateY(-3px);
}

.cd-quick-link-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
}

.cd-quick-link-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cd-text-muted);
}

.cd-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cd-card {
    background: var(--cd-card);
    border: 1px solid var(--cd-border);
    border-radius: 16px;
    box-shadow: var(--cd-shadow);
}

.cd-card-inner {
    padding: 18px;
}

.cd-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.cd-input,
.cd-select,
.cd-textarea {
    width: 100%;
    border: 1px solid var(--cd-border);
    border-radius: 12px;
    background: #fff;
    color: var(--cd-text);
    padding: 10px 12px;
    font: inherit;
    outline: none;
}

.cd-input:focus,
.cd-select:focus,
.cd-textarea:focus {
    border-color: var(--cd-primary);
    box-shadow: 0 0 0 3px rgba(10, 84, 57, 0.16);
}

.cd-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--cd-text-muted);
}

.cd-btn {
    border: 1px solid transparent;
    border-radius: 12px;
    background: #fff;
    color: var(--cd-text);
    padding: 9px 13px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.14s ease;
}

.cd-btn:hover {
    transform: translateY(-1px);
}

.cd-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.cd-btn-primary {
    background: var(--cd-primary);
    border-color: var(--cd-primary);
    color: #fff;
}

.cd-btn-primary:hover {
    background: #08653f;
}

.cd-btn-soft {
    background: var(--cd-primary-soft);
    border-color: #c5ddd0;
    color: #07422d;
}

.cd-btn-ghost {
    background: #fff;
    border-color: var(--cd-border);
    color: var(--cd-text-muted);
}

.cd-btn-danger {
    background: #fff2f2;
    border-color: #f0c8c8;
    color: var(--cd-danger);
}

.cd-status {
    margin-top: 10px;
    font-size: 0.9rem;
    min-height: 20px;
}

.cd-status.error {
    color: var(--cd-danger);
}

.cd-status.success {
    color: var(--cd-success);
}

.cd-auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
}

.cd-auth-card {
    width: min(460px, 100%);
    padding: 26px;
}

.cd-auth-form {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.cd-auth-form .cd-input {
    flex: 1;
}

.cd-auth-help {
    margin-top: 12px;
    color: var(--cd-text-muted);
    font-size: 0.86rem;
}

/* ── 404 Error ── */
.cd-error-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.cd-error-card {
    width: min(420px, 100%);
    padding: 40px 26px 32px;
    text-align: center;
}

.cd-error-img {
    width: 180px;
    height: auto;
    margin-bottom: 8px;
}

.cd-error-code {
    margin: 0;
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--cd-primary);
    letter-spacing: -0.03em;
}

.cd-error-msg {
    margin: 8px 0 24px;
    color: var(--cd-text-muted);
    font-size: 0.95rem;
}

.cd-error-btn {
    display: inline-block;
    padding: 10px 24px;
    text-decoration: none;
    font-size: 0.92rem;
}

.cd-reader-layout {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) 180px;
    gap: 14px;
    align-items: start;
}

.cd-reader-layout--no-banners {
    display: block;
}

.cd-reader-main {
    min-width: 0;
}

.cd-reader-heading {
    margin: 0;
    font-size: 1.16rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.cd-banner-rail {
    border: 1px solid var(--cd-border);
    border-radius: 14px;
    background: linear-gradient(180deg, #fdfcf8 0%, #f5f2ec 100%);
    box-shadow: 0 10px 24px rgba(80, 60, 30, 0.1);
    padding: 11px;
    position: sticky;
    top: 14px;
}

.cd-banner-title {
    margin: 2px 0 8px;
    color: #5a5047;
    font-size: 0.82rem;
    font-weight: 700;
}

.cd-banner-link {
    display: grid;
    border: 1px solid #d5cdc0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    min-height: 260px;
}

.cd-banner-link picture {
    display: block;
    width: 100%;
}

.cd-banner-empty {
    display: grid;
    place-items: center;
    text-align: center;
    padding: 18px 10px;
    min-height: 260px;
    color: #8a7e72;
    font-size: 0.83rem;
    line-height: 1.45;
    background:
        linear-gradient(135deg, rgba(210, 200, 180, 0.45), rgba(240, 235, 225, 0.65)),
        repeating-linear-gradient(
            -45deg,
            rgba(140, 125, 100, 0.08),
            rgba(140, 125, 100, 0.08) 8px,
            rgba(140, 125, 100, 0) 8px,
            rgba(140, 125, 100, 0) 16px
        );
}

.cd-banner-image {
    display: block;
    width: 100%;
    height: auto;
}

.cd-banner-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.cd-banner-dot {
    width: 8px;
    height: 8px;
    border: none;
    border-radius: 50%;
    background: #c5bfb0;
    padding: 0;
    cursor: pointer;
}

.cd-banner-dot.active {
    background: var(--cd-primary);
}

.cd-drive-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 14px;
    align-items: start;
}

.cd-folder-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.cd-folder {
    position: relative;
    padding: 0;
    border: 1px solid #d5cdc0;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #faf8f4 100%);
    cursor: pointer;
    transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
    box-shadow: 0 10px 20px rgba(60, 50, 30, 0.08);
    text-align: left;
    overflow: hidden;
    min-height: auto;
    display: flex;
    flex-direction: row;
}

.cd-folder:hover {
    border-color: #a5c4b0;
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(60, 50, 30, 0.15);
}

.cd-folder.active {
    border-color: #0a5439;
    background: linear-gradient(180deg, #e8f0e8 0%, #e0efe8 100%);
    box-shadow: 0 14px 26px rgba(40, 80, 50, 0.2);
}

.cd-folder.cd-highlight {
    animation: cd-pulse-highlight 0.6s ease-in-out 3;
    border-color: #F5C946;
}

@keyframes cd-pulse-highlight {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(245, 201, 70, 0.4);
        background: linear-gradient(180deg, #fffdf5 0%, #fff9e6 100%);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(245, 201, 70, 0.15);
        background: linear-gradient(180deg, #fff8dc 0%, #ffeeb0 100%);
    }
}

.cd-folder.disabled {
    border-color: #d1cec8;
    background: linear-gradient(180deg, #f6f4f0 0%, #ece9e3 100%);
    box-shadow: none;
    cursor: not-allowed;
}

.cd-folder.disabled .cd-folder-cover,
.cd-folder.disabled .cd-folder-cover-empty,
.cd-folder.disabled .cd-folder-title,
.cd-folder.disabled .cd-folder-sub,
.cd-folder.disabled .cd-folder-expiry,
.cd-folder.disabled .cd-folder-count {
    opacity: 0.5;
    filter: grayscale(0.7);
}

.cd-folder.disabled:hover {
    transform: none;
    border-color: #d1cec8;
    box-shadow: none;
}

/* 구매 완료 상품 강조 */
.cd-folder.purchased {
    border-width: 2px;
    border-color: #90caf9;
    background: linear-gradient(180deg, #e8f4fd 0%, #d6ecf9 100%);
}

.cd-folder.purchased:hover {
    border-width: 2px;
    border-color: #64b5f6;
    background: linear-gradient(180deg, #e1f0fb 0%, #cce5f7 100%);
    box-shadow: 0 14px 24px rgba(68, 97, 242, 0.15);
}

.cd-folder-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cd-folder-icon {
    width: 17px;
    height: 13px;
    border: 1px solid #1a7a55;
    border-radius: 3px;
    background: #5da87a;
    flex-shrink: 0;
    position: relative;
}

.cd-folder-icon::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 1px;
    width: 9px;
    height: 5px;
    border: 1px solid #1a7a55;
    border-bottom: none;
    border-radius: 2px 2px 0 0;
    background: #6fb88a;
}

.cd-folder.disabled .cd-folder-icon {
    border-color: #a5a29c;
    background: #d8d5ce;
}

.cd-folder.disabled .cd-folder-icon::before {
    border-color: #a5a29c;
    background: #d8d5ce;
}

.cd-folder-title {
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.35;
    word-break: keep-all;
}

.cd-folder-sub {
    margin: 8px 0 6px;
    color: #6a6558;
    font-size: 0.78rem;
}

.cd-folder-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--cd-text-muted);
    font-size: 0.82rem;
    margin-top: auto;
}

.cd-folder-count {
    color: #605a4e;
    font-weight: 600;
}

.cd-folder-badges {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

/* 상품 카드 왼쪽 상단 오버레이 배지 */
.cd-card-badges-top {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}

.cd-card-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 6px;
    line-height: 1.3;
    white-space: nowrap;
}

.cd-card-badge-new {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: #fff;
    border: none;
    box-shadow: 0 2px 6px rgba(238, 90, 36, 0.3);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.cd-card-badge-full {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #81c784;
}


.cd-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--cd-border);
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 700;
}

.cd-badge-new {
    border: none;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: #fff;
    padding: 2px 10px;
    font-size: 0.68rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(238, 90, 36, 0.3);
}

.cd-badge-lock {
    border-color: #e0a0a0;
    background: #fdeaea;
    color: #b04040;
    font-weight: 600;
}

.cd-file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cd-file-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--cd-border);
    background: #fff;
}
.cd-file-item .cd-badge-new {
    position: absolute;
    top: -8px;
    left: 10px;
    z-index: 1;
}

.cd-file-info {
    min-width: 0;
    flex: 1;
}

.cd-file-item .cd-btn,
.cd-file-item .cd-btn-link-visit {
    white-space: nowrap;
    flex-shrink: 0;
}

.cd-file-item .cd-btn-link-visit {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.cd-file-name {
    margin: 0;
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cd-file-date {
    margin: 4px 0 0;
    color: var(--cd-text-muted);
    font-size: 0.78rem;
}

.cd-table-wrap {
    overflow: auto;
    border: 1px solid var(--cd-border);
    border-radius: 12px;
}

.cd-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.cd-table th,
.cd-table td {
    border-bottom: 1px solid var(--cd-border);
    text-align: left;
    padding: 10px 12px;
    vertical-align: top;
    font-size: 0.87rem;
}

.cd-table th {
    background: #f4f2ed;
    color: var(--cd-text-muted);
    font-weight: 700;
}

.cd-table tr:last-child td {
    border-bottom: none;
}

.cd-inline-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cd-inline-input .cd-input {
    min-width: 240px;
}

.cd-tab {
    padding: 8px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #88807a;
    cursor: pointer;
}
.cd-tab:hover { color: #1a6b48; }
.cd-tab.active {
    color: var(--cd-primary);
    border-bottom-color: var(--cd-primary);
}

.cd-banner-admin-panel {
    border: 1px solid var(--cd-border);
    border-radius: 12px;
    padding: 12px;
    background: #fdfcf8;
}

.cd-banner-admin-title {
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: var(--cd-text);
}

.cd-banner-upload-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cd-banner-admin-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.cd-banner-admin-item {
    display: flex;
    gap: 10px;
    border: 1px solid var(--cd-border);
    border-radius: 10px;
    background: #fff;
    padding: 10px;
}

.cd-banner-admin-preview {
    width: 82px;
    aspect-ratio: 3 / 4;
    border-radius: 8px;
    border: 1px solid #ddd8ce;
    object-fit: cover;
    background: #f5f3ed;
}

.cd-banner-admin-fields {
    flex: 1;
    min-width: 0;
}

.cd-banner-admin-controls {
    margin-top: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.cd-banner-order-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--cd-text-muted);
    font-size: 0.8rem;
}

.cd-banner-order-input {
    width: 72px;
    min-width: 0;
    padding: 8px 10px;
}

.cd-banner-mobile-section {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cd-banner-admin-mobile-preview {
    max-width: 200px;
    max-height: 80px;
    border-radius: 6px;
    border: 1px solid var(--cd-border);
    object-fit: cover;
}

.cd-banner-admin-mobile-empty {
    font-size: 0.78rem;
    color: var(--cd-text-muted);
}

.cd-banner-mobile-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cd-btn-sm {
    padding: 4px 10px;
    font-size: 0.78rem;
}

.cd-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px 10px;
    max-height: 220px;
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--cd-border);
    border-radius: 12px;
    background: #fdfcf8;
}

.cd-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--cd-text);
}

.cd-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.cd-summary-card {
    border: 1px solid var(--cd-border);
    background: #fff;
    border-radius: 12px;
    padding: 14px;
}

.cd-summary-label {
    margin: 0 0 6px;
    font-size: 0.82rem;
    color: var(--cd-text-muted);
}

.cd-summary-value {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.cd-empty {
    border: 1px dashed var(--cd-border-strong);
    border-radius: 12px;
    padding: 16px;
    color: var(--cd-text-muted);
    font-size: 0.9rem;
    background: #fdfcf8;
}

.cd-mt-12 {
    margin-top: 12px;
}

.cd-mt-16 {
    margin-top: 16px;
}

.cd-mt-22 {
    margin-top: 22px;
}

.cd-space {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cd-link {
    color: #0a5439;
    text-decoration: none;
}

.cd-link:hover {
    text-decoration: underline;
}

.cd-folder-cover {
    width: 100px;
    min-width: 100px;
    aspect-ratio: 3 / 4;
    object-fit: contain;
    border-radius: 12px 0 0 12px;
    display: block;
    background: transparent;
    margin-left: 8px;
}

.cd-folder-cover-empty {
    width: 100px;
    min-width: 100px;
    aspect-ratio: 3 / 4;
    background: #e8e4dc;
    border-radius: 12px 0 0 12px;
}

.cd-folder-body {
    padding: 14px 16px;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cd-btn-sm {
    padding: 5px 9px;
    font-size: 0.8rem;
    border-radius: 8px;
}

.cd-ty-tab,
.bulk-ty-tab {
    background: var(--cd-bg-tertiary, #f5f0eb);
    color: var(--cd-text-muted, #7a7068);
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.cd-ty-tab.active,
.bulk-ty-tab.active {
    background: var(--cd-primary, #0a5439);
    color: #fff;
    border-color: var(--cd-primary, #0a5439);
    font-weight: 600;
}

.cd-input-sm {
    padding: 6px 8px;
    font-size: 0.82rem;
}

.cd-cover-admin {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.cd-cover-badge-row {
    display: flex;
    align-items: center;
    gap: 4px;
}
.cd-cover-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.cd-cover-badge--on {
    background: var(--cd-success-bg, #dcfce7);
    color: var(--cd-success, #16a34a);
    border: 1px solid var(--cd-success, #16a34a);
}
.cd-cover-badge--on:hover {
    filter: brightness(0.95);
}
.cd-cover-badge--off {
    background: #f3f4f6;
    color: #9ca3af;
    border: 1px solid #d1d5db;
}
.cd-cover-badge-del {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid var(--cd-danger, #ef4444);
    background: transparent;
    color: var(--cd-danger, #ef4444);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0.7;
    transition: all 0.15s;
}
.cd-cover-badge-del:hover {
    opacity: 1;
    background: var(--cd-danger, #ef4444);
    color: #fff;
}

/* ── Global Touch & Mobile Input ── */
body.cd-page {
    -webkit-tap-highlight-color: transparent;
}

.cd-btn:active:not(:disabled) {
    transform: scale(0.97);
}

/* -- Suggestion Board --------------------------------- */
.cd-suggestion-desc {
    text-align: center;
    color: var(--cd-text-muted);
    margin-bottom: 20px;
    font-size: 0.92rem;
}

.cd-suggestion-form {
    margin-bottom: 24px;
}

.cd-suggestion-title-input {
    margin-bottom: 8px;
    font-weight: 600;
}

.cd-suggestion-content-input {
    resize: vertical;
    min-height: 80px;
    margin-bottom: 8px;
}

.cd-suggestion-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cd-suggestion-card {
    margin-bottom: 12px;
}

.cd-suggestion-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.cd-suggestion-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--cd-text);
}

.cd-suggestion-card-meta {
    font-size: 0.8rem;
    color: var(--cd-text-muted);
    white-space: nowrap;
}

.cd-suggestion-card-content {
    font-size: 0.9rem;
    color: var(--cd-text);
    line-height: 1.6;
    margin: 0 0 10px;
    word-break: break-word;
}

.cd-suggestion-card-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.cd-suggestion-delete-btn {
    background: none;
    border: 1px solid var(--cd-border);
    border-radius: 16px;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--cd-text-muted);
    transition: all 0.15s ease;
}

.cd-suggestion-delete-btn:hover {
    border-color: var(--cd-danger);
    color: var(--cd-danger);
}

.cd-suggestion-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid var(--cd-border);
    border-radius: 16px;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--cd-text-muted);
    transition: all 0.15s ease;
}

.cd-suggestion-like-btn:hover:not(.liked):not(:disabled) {
    border-color: #e74c3c;
    color: #e74c3c;
}

.cd-suggestion-like-btn.liked {
    border-color: #e74c3c;
    color: #e74c3c;
    cursor: pointer;
}

.cd-like-icon {
    vertical-align: middle;
}

.cd-like-count {
    font-weight: 600;
}

/* -- Comments -- */
.cd-comments-section {
    border-top: 1px solid var(--cd-border);
    margin-top: 12px;
    padding-top: 12px;
}

.cd-comments-list {
    margin-bottom: 10px;
}

.cd-comments-empty {
    font-size: 0.85rem;
    padding: 8px 0;
}

.cd-comment-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--cd-border-light, rgba(0,0,0,0.06));
}

.cd-comment-item:last-child {
    border-bottom: none;
}

.cd-comment-reply {
    margin-left: 24px;
    padding-left: 12px;
    border-left: 2px solid var(--cd-border);
}

.cd-comment-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.cd-comment-author {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cd-text);
}

.cd-comment-date {
    font-size: 0.75rem;
    color: var(--cd-text-muted);
}

.cd-comment-body {
    font-size: 0.88rem;
    line-height: 1.5;
    margin: 0 0 6px;
    word-break: break-word;
    color: var(--cd-text);
}

.cd-comment-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cd-comment-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--cd-text-muted);
    transition: color 0.15s;
}

.cd-comment-like-btn:hover:not(.liked) {
    color: #e74c3c;
}

.cd-comment-like-btn.liked {
    color: #e74c3c;
}

.cd-reply-btn,
.cd-comment-delete-btn {
    background: none;
    border: none;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--cd-text-muted);
    transition: color 0.15s;
}

.cd-reply-btn:hover {
    color: var(--cd-primary);
}

.cd-comment-delete-btn:hover {
    color: var(--cd-danger);
}

.cd-comment-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: none;
    border: 1px solid var(--cd-border);
    border-radius: 16px;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--cd-text-muted);
    transition: all 0.15s ease;
}

.cd-comment-toggle-btn:hover {
    border-color: var(--cd-primary);
    color: var(--cd-primary);
}

.cd-comment-write {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-top: 8px;
}

.cd-comment-write .cd-comment-input {
    flex: 1;
    min-height: 36px;
    resize: vertical;
    font-size: 0.85rem;
}

.cd-btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
    white-space: nowrap;
    align-self: flex-end;
}

.cd-reply-write {
    margin-left: 24px;
    margin-bottom: 8px;
}

.cd-comment-admin {
    background: #eef4ff;
    border-left: 3px solid #3b82f6;
    padding-left: 12px;
}

.cd-comment-admin .cd-comment-author {
    color: #3b82f6;
}

.cd-admin-badge {
    display: inline-block;
    background: #3b82f6;
    color: #fff;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 4px;
    vertical-align: middle;
}

.suggestion-comment-panel {
    padding: 12px 16px;
    background: #fafafa;
    border-top: 1px solid #eee;
}

.cd-reply-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 2px 6px;
}

.cd-reply-btn:hover {
    color: #3b82f6;
}

.cd-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}

.cd-page-btn {
    min-width: 36px;
    height: 36px;
    border: 1px solid var(--cd-border);
    border-radius: 8px;
    background: var(--cd-card);
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--cd-text-muted);
    transition: all 0.15s ease;
}

.cd-page-btn:hover {
    border-color: var(--cd-primary);
    color: var(--cd-primary);
}

.cd-page-btn.active {
    background: var(--cd-primary);
    border-color: var(--cd-primary);
    color: #fff;
}

.cd-page-dots {
    display: flex;
    align-items: center;
    padding: 0 4px;
    color: var(--cd-text-muted);
    font-size: 0.88rem;
    user-select: none;
}

@media (max-width: 1200px) {
    .cd-folder-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) and (min-width: 641px) {
    .cd-reader-layout {
        display: block;
    }

    .cd-banner-rail {
        display: none;
    }
}

@media (max-width: 960px) {
    .cd-drive-layout {
        grid-template-columns: 1fr;
    }

    .cd-summary-grid {
        grid-template-columns: 1fr;
    }

    .cd-grid-2 {
        grid-template-columns: 1fr;
    }

    .cd-banner-admin-item {
        flex-direction: column;
    }

    .cd-banner-admin-preview {
        width: 100%;
        aspect-ratio: 16 / 9;
    }
}

/* See also: consolidated mobile block at end of file */
@media (max-width: 640px) {
    .cd-container {
        padding: 22px 12px 36px;
    }

    .cd-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .cd-title-row {
        flex-direction: column;
        gap: 4px;
    }

    .cd-top-bar {
        position: static;
    }

    .cd-auth-form {
        flex-direction: column;
    }

    .cd-folder-grid {
        grid-template-columns: 1fr;
    }

    .cd-welcome-row {
        flex-direction: column;
        gap: 10px;
    }

    .cd-sns-buttons {
        justify-content: center;
    }

    .cd-sns-btn svg {
        width: 38px;
        height: 38px;
    }

    .cd-quick-links {
        gap: 20px;
    }

    .cd-quick-link-icon {
        width: 52px;
        height: 52px;
        border-radius: 14px;
    }

    .cd-quick-link-label {
        font-size: 0.76rem;
    }
}

/* Modal overlay for refund warning */
.cd-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.cd-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.cd-modal {
    background: var(--cd-card);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    width: min(440px, 90%);
    padding: 28px;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.cd-modal-overlay.active .cd-modal {
    transform: scale(1);
}

.cd-modal-title {
    margin: 0 0 12px;
    font-size: 1.15rem;
    font-weight: 700;
}

.cd-modal-body {
    color: var(--cd-text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 22px;
}

.cd-modal-warning {
    color: var(--cd-danger);
    font-weight: 600;
}

.cd-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Admin login */
.cd-admin-login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
}

.cd-admin-login-card {
    width: min(400px, 100%);
    padding: 26px;
}

.cd-admin-login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

/* DB Stats monitoring */
.cd-db-stats {
    border: 1px solid var(--cd-border);
    border-radius: 12px;
    padding: 16px;
    background: #fff;
}

.cd-db-stats-title {
    margin: 0 0 12px;
    font-size: 0.95rem;
    font-weight: 700;
}

.cd-progress-bar {
    width: 100%;
    height: 12px;
    background: #e8e4dc;
    border-radius: 6px;
    overflow: hidden;
    margin: 8px 0;
}

.cd-progress-bar-fill {
    height: 100%;
    border-radius: 6px;
    background: var(--cd-primary);
    transition: width 0.3s ease;
}

.cd-progress-bar-fill.warning {
    background: #e6a23c;
}

.cd-progress-bar-fill.danger {
    background: var(--cd-danger);
}

.cd-db-stats-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.cd-db-stats-item {
    text-align: center;
}

.cd-db-stats-label {
    font-size: 0.78rem;
    color: var(--cd-text-muted);
}

.cd-db-stats-value {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 2px;
}

/* Breadcrumb navigation */
.cd-breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #f8f6f2;
    border-radius: 6px;
    font-size: 13px;
    flex-wrap: wrap;
}
.cd-breadcrumb-back {
    cursor: pointer;
    font-size: 16px;
    margin-right: 8px;
    color: #5e5650;
    background: none;
    border: none;
    padding: 0;
}
.cd-breadcrumb-back:hover { color: #3a352f; }
.cd-breadcrumb-link {
    cursor: pointer;
    color: #1a7a55;
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
}
.cd-breadcrumb-link:hover { text-decoration: underline; }
.cd-breadcrumb-current {
    font-weight: 600;
    color: #3a352f;
}
.cd-breadcrumb-sep { color: #c0b8ae; }

/* Download All button row */
.cd-download-all-row {
    display: flex;
    justify-content: flex-end;
    padding: 0 0 8px;
}
.cd-btn-download-all {
    font-size: 13px;
    padding: 6px 14px;
}

/* Folder item in browse view */
.cd-folder-item {
    cursor: pointer;
}
.cd-folder-item:hover {
    background: #f0ede6;
}
.cd-folder-count {
    font-size: 12px;
    color: #8a827a;
    margin-left: 8px;
}
.cd-file-icon {
    margin-right: 8px;
    font-size: 16px;
}
.cd-file-size {
    font-size: 12px;
    color: #8a827a;
    margin-left: 8px;
}

/* Empty folder message */
.cd-empty-message {
    text-align: center;
    color: #8a827a;
    padding: 40px 0;
    font-size: 14px;
}

/* Category grouping on drive page */
.cd-category-group {
    margin-bottom: 24px;
    border: 1px solid var(--cd-border);
    border-radius: 16px;
    padding: 16px;
    background: var(--cd-card-soft);
}
.cd-category-header {
    margin: 0 0 12px;
    font-size: 1.05rem;
    font-weight: 700;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--cd-border);
}

.cd-ml-8 { margin-left: 8px; }

/* Browser header with back button */
.cd-browser-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.cd-btn-back {
    flex-shrink: 0;
    font-size: 0.9rem;
}

/* ── Drag & Drop ordering ── */
.cd-drag-handle-cell {
    width: 36px;
    text-align: center;
    padding: 0 4px !important;
}
.cd-drag-handle {
    cursor: grab;
    user-select: none;
    font-size: 1.1rem;
    color: var(--cd-text-muted);
    opacity: 0.6;
    transition: opacity 0.15s;
}
.cd-drag-handle:hover {
    opacity: 1;
    color: var(--cd-primary);
}
tr[draggable="true"] {
    cursor: grab;
}
tr.cd-drag-active {
    opacity: 0.4;
    background: var(--cd-card-soft);
}
tr.cd-drag-over-top {
    box-shadow: inset 0 2px 0 0 var(--cd-primary);
}
tr.cd-drag-over-bottom {
    box-shadow: inset 0 -2px 0 0 var(--cd-primary);
}
.cd-drag-clone {
    position: fixed;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.85;
    background: var(--cd-card);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    display: table-row;
}

/* ══════════════════════════════════════════════════════
   Template Highlight Overlay — {{link}} 하이라이트
   ══════════════════════════════════════════════════════ */
.tpl-highlight-wrap {
    position: relative;
    display: block;
}
.tpl-highlight-wrap textarea {
    position: relative;
    z-index: 2;
    background: transparent;
    caret-color: var(--cd-text, #1e293b);
    color: transparent;
}
.tpl-highlight-wrap textarea::selection {
    background: rgba(10, 84, 57, 0.25);
    color: transparent;
}
.tpl-highlight-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
    /* textarea와 동일한 스타일 복제 */
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--cd-card, #fff);
    padding: 10px 12px;
    font: inherit;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: var(--cd-text, #1e293b);
    box-sizing: border-box;
    width: 100%;
    line-height: inherit;
}
.tpl-highlight-mark {
    background: transparent;
    color: #0a5439;
    font-weight: 700;
}

/* ══════════════════════════════════════════════════════
   Mobile Responsive — 640px breakpoint (consolidated)
   Tasks 1-4: 공통, 드라이브, 인증/에러/공지, 관리자
   ══════════════════════════════════════════════════════ */
@media (max-width: 640px) {

    /* ── Task 1: 공통 — 터치 타겟 및 기본 모바일 개선 ── */
    .cd-btn {
        min-height: 44px;
        padding: 12px 16px;
    }

    .cd-btn-sm {
        min-height: 36px;
        padding: 8px 12px;
    }

    .cd-input,
    .cd-select,
    .cd-textarea {
        min-height: 44px;
        font-size: 16px;
    }

    .cd-title {
        font-size: 1.3rem;
    }

    .cd-title-center {
        font-size: 1.6rem;
    }

    /* ── Task 2: 드라이브 — 배너 및 레이아웃 모바일 최적화 ── */
    .cd-reader-layout {
        display: block;
    }

    .cd-banner-rail {
        position: static;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px;
        border-radius: 10px;
        margin-bottom: 12px;
    }

    .cd-banner-rail:last-child {
        margin-bottom: 0;
        margin-top: 12px;
    }

    .cd-banner-title {
        display: none;
    }

    .cd-banner-link {
        min-height: auto;
        border-radius: 8px;
        flex: 1;
    }

    .cd-banner-image {
        border-radius: 8px;
        max-height: 100px;
        object-fit: cover;
    }

    .cd-banner-empty {
        min-height: 60px;
        font-size: 0.78rem;
        padding: 10px;
    }

    .cd-banner-dots {
        margin-top: 4px;
        flex-direction: row;
        justify-content: center;
        width: 100%;
        gap: 4px;
    }

    .cd-folder-cover,
    .cd-folder-cover-empty {
        width: 72px;
        min-width: 72px;
    }

    .cd-folder-body {
        padding: 10px 12px;
    }

    .cd-folder-title {
        font-size: 0.88rem;
    }

    .cd-file-item {
        padding: 12px;
    }

    .cd-breadcrumb {
        padding: 10px 14px;
    }

    .cd-breadcrumb-back {
        font-size: 20px;
        min-width: 32px;
        min-height: 32px;
    }

    .cd-breadcrumb-link {
        font-size: 14px;
        padding: 2px 0;
    }

    /* ── Task 3: 인증/에러/공지 — 미세 모바일 조정 ── */
    .cd-auth-card {
        padding: 20px;
    }

    .cd-error-img {
        width: 120px;
    }

    .cd-error-code {
        font-size: 2rem;
    }

    .cd-error-btn {
        min-height: 44px;
        padding: 12px 28px;
    }

    /* ── Task 4: 관리자 — 기본 터치 타겟 개선 ── */
    .cd-card-inner {
        padding: 14px;
    }

    .cd-tab {
        padding: 10px 16px;
        min-height: 40px;
    }

    .cd-checkbox {
        gap: 10px;
        min-height: 36px;
    }

    .cd-inline-input .cd-input {
        min-width: 0;
    }

    .cd-banner-admin-preview {
        width: 60px;
        aspect-ratio: 3 / 4;
    }


    .cd-suggestion-card-header {
        flex-direction: column;
        gap: 4px;
    }
    .cd-suggestion-form-footer {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
}

/* 구매완료 배지 - 하단 메타 영역 */
.cd-badge-full {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #ffffff;
    background: #4461F2;
    border: 1px solid #3a54d4;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}

/* 맛보기 배지 - 미구매 상품 */
.cd-badge-preview {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #f57c00;
    background: #fff3e0;
    border: 1px solid #ffcc80;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}

/* 만료 배지 - 어드민 & 고객 */
.cd-badge-expired {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #c62828;
    background: #fdecea;
    border: 1px solid #ef9a9a;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}

.cd-badge-review {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    background: #28a745;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}

/* 리뷰이벤트 잠금 폴더 */
.cd-review-event-locked {
    opacity: 0.7;
    cursor: default !important;
}

.cd-review-event-locked .cd-file-info {
    flex: 1;
}

.cd-review-event-hint {
    font-size: 0.8rem;
    color: #8a827a;
    margin-left: 8px;
}

.cd-btn-outline {
    display: inline-block;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cd-accent, #1a6b48);
    background: transparent;
    border: 1.5px solid var(--cd-accent, #1a6b48);
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.cd-btn-outline:hover {
    background: var(--cd-accent, #1a6b48);
    color: #fff;
}

/* 미리보기 CTA 버튼 */
.cd-btn-preview-cta {
    display: block;
    margin: 20px auto 0;
    padding: 12px 32px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cd-primary, #0a5439);
    background: transparent;
    border: 1.5px solid var(--cd-primary, #0a5439);
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    max-width: 320px;
    transition: background 0.15s, color 0.15s;
}

.cd-btn-preview-cta:hover {
    background: var(--cd-primary, #0a5439);
    color: #fff;
}

/* 만료일 설정 행 - 어드민 고객 폼 */
.cd-product-expiry-row {
    padding: 6px 0;
}
.cd-customer-product-group {
    margin-bottom: 12px;
}
.cd-customer-product-group-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #5e5650;
    padding: 4px 0 2px;
    border-bottom: 1px solid #ddd8d0;
    margin-bottom: 4px;
}
.cd-expiry-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    border: 1px solid #d0cbc2;
    border-radius: 6px;
    padding: 6px 10px;
    margin: 4px 0 0 24px;
    background: #f8f6f2;
}
.cd-expiry-options {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cd-no-expiry {
    font-size: 0.85rem;
    white-space: nowrap;
}
.cd-review-event-label {
    font-size: 0.85rem;
    white-space: nowrap;
    cursor: pointer;
}
.cd-review-event-label input[type="checkbox"] {
    cursor: pointer;
}

/* 드라이브 상품 카드 이용 기한 */
.cd-folder-expiry {
    font-size: 0.75rem;
    color: #5e5650;
    margin: 2px 0 0;
}
.cd-folder-expiry-past {
    color: #dc3545;
    font-weight: 600;
}

/* Email modal */
.cd-modal.cd-email-modal{width:min(1200px,92vw);max-height:88vh;overflow-y:auto;padding:28px 24px}
.cd-email-modal-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.cd-email-close{background:none;border:none;font-size:1.5rem;cursor:pointer;color:var(--cd-text-muted);line-height:1}
.cd-email-tabs{display:flex;gap:0;border-bottom:2px solid #e2ddd5;margin-bottom:16px}
.cd-email-form{display:flex;flex-direction:column;gap:4px}
.cd-email-checkbox{display:inline-flex;align-items:center;gap:6px;font-size:.88rem;cursor:pointer}
.cd-email-unread-controls{display:flex;align-items:center;gap:8px;margin-bottom:12px}
.cd-email-list{display:flex;flex-direction:column;gap:10px;max-height:400px;overflow-y:auto}
.cd-email-item{background:var(--cd-bg);border:1px solid #e2ddd5;border-radius:10px;padding:12px}
.cd-email-item-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}
.cd-email-from{font-weight:600;font-size:.9rem}
.cd-email-date{font-size:.78rem;color:var(--cd-text-muted)}
.cd-email-subject{font-size:.88rem;font-weight:500;margin-bottom:4px}
.cd-email-preview{font-size:.82rem;color:var(--cd-text-muted);background:#f8f6f2;border-radius:6px;padding:8px;margin-bottom:8px;white-space:pre-wrap;max-height:100px;overflow-y:auto}
.cd-email-item-actions{display:flex;align-items:center;gap:12px}
.cd-email-template-section{margin-top:8px;border-top:1px solid #e2ddd5;padding-top:8px;width:100%}
.cd-email-template-section summary{cursor:pointer;font-weight:600;font-size:.9rem;color:var(--cd-text-muted)}
.cd-email-template-body{margin-top:10px;width:100%}
.cd-email-form,.cd-email-unread,.cd-email-tabs{width:100%}
.cd-email-template-actions{display:flex;gap:8px}

/* ── Errata Modal (Admin) ── */
.cd-modal-lg {
    width: min(900px, 95vw);
    max-height: 85vh;
    overflow-y: auto;
    background: var(--cd-card);
    border-radius: 12px;
    box-shadow: var(--cd-shadow);
    padding: 0;
}
.cd-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--cd-border);
}
.cd-modal-header h3 { margin: 0; font-size: 1.1rem; }
.cd-modal-close {
    background: none; border: none; font-size: 1.5rem;
    cursor: pointer; color: var(--cd-text-muted); padding: 0 4px;
}
.cd-modal-close:hover { color: var(--cd-danger); }
.cd-modal-body { padding: 16px 20px 20px; }

.cd-errata-form-row {
    display: flex; gap: 8px; margin-bottom: 8px;
}
.cd-errata-form-row textarea {
    resize: vertical; min-height: 48px;
}
.cd-errata-form-actions {
    display: flex; gap: 8px; margin-bottom: 8px;
}

/* ── Errata Table (Shared) ── */
.cd-errata-table {
    width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.cd-errata-table th {
    background: var(--cd-primary-soft); color: var(--cd-text);
    font-weight: 600; padding: 8px 10px; text-align: left;
    border-bottom: 2px solid var(--cd-border-strong); white-space: nowrap;
}
.cd-errata-table td {
    padding: 8px 10px; border-bottom: 1px solid var(--cd-border);
    vertical-align: middle; line-height: 1.5;
}
.cd-errata-table tr:hover td { background: rgba(10, 84, 57, 0.04); }
.cd-errata-no, .cd-errata-date {
    text-align: center; white-space: nowrap; font-weight: 500;
}
.cd-errata-page {
    text-align: center; white-space: nowrap;
    color: var(--cd-primary); font-weight: 500;
}
.cd-errata-before { background: #fff5f5; min-width: 150px; }
.cd-errata-after { background: #f0fff4; min-width: 150px; }
.cd-errata-desc { color: var(--cd-text-muted); font-size: 0.82rem; }

/* ── Errata Quill Editor ── */
.cd-errata-editor-group {
    margin-bottom: 10px;
}
.cd-errata-editor-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cd-text-muted);
    margin-bottom: 4px;
}
.cd-errata-quill {
    background: var(--cd-card);
    border-radius: 0 0 6px 6px;
    min-height: 80px;
}
.cd-errata-quill .ql-editor {
    min-height: 60px;
    font-size: 0.9rem;
    line-height: 1.6;
}
.cd-errata-quill .ql-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 4px 0;
}

/* ── Errata Table Image Styling ── */
.cd-errata-table td img,
.cd-errata-card img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 4px 0;
    display: block;
    cursor: pointer;
    transition: opacity 0.15s;
}
.cd-errata-table td img:hover,
.cd-errata-card img:hover {
    opacity: 0.8;
}

/* ── Image Lightbox ── */
.cd-lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}
.cd-lightbox-overlay.active {
    display: flex;
}
.cd-lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    cursor: default;
}
.cd-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.2rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.15s;
}
.cd-lightbox-close:hover {
    opacity: 1;
}

/* ── Errata Modal ── */
.cd-errata-modal {
    width: min(900px, 94vw);
    max-height: 85vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.cd-errata-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px; border-bottom: 1px solid var(--cd-border);
    flex-shrink: 0;
}
.cd-errata-modal-header h3 {
    margin: 0; font-size: 1.1rem; display: flex; align-items: center; gap: 8px;
}
.cd-errata-modal-body {
    padding: 16px 24px 24px;
    overflow-y: auto;
    flex: 1;
}

/* ── Errata Table (shared admin/customer) ── */
.cd-errata-count {
    color: var(--cd-text-muted); font-size: 0.85rem;
}
.cd-errata-notice {
    background: #f0f7ff;
    border: 1px solid #d0e3f7;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.85rem;
    color: #3a6fa0;
    line-height: 1.5;
}
.cd-errata-table-wrap { overflow-x: auto; }

/* ── Errata Mobile Cards ── */
.cd-errata-mobile { display: none; }
.cd-errata-card {
    padding: 12px 14px; border-bottom: 1px solid var(--cd-border);
}
.cd-errata-card:last-child { border-bottom: none; }
.cd-errata-card-header {
    display: flex; justify-content: space-between; margin-bottom: 8px;
    font-size: 0.82rem; color: var(--cd-text-muted);
}
.cd-errata-card-page { color: var(--cd-primary); font-weight: 600; }
.cd-errata-card-diff { display: flex; flex-direction: column; gap: 6px; }
.cd-errata-card-before {
    background: #fff5f5; padding: 8px 10px; border-radius: 6px;
    font-size: 0.85rem; line-height: 1.5;
}
.cd-errata-card-after {
    background: #f0fff4; padding: 8px 10px; border-radius: 6px;
    font-size: 0.85rem; line-height: 1.5;
}
.cd-errata-label {
    display: block; font-size: 0.75rem; font-weight: 600;
    margin-bottom: 4px; color: var(--cd-text-muted);
}
.cd-errata-card-desc {
    margin-top: 6px; font-size: 0.82rem; color: var(--cd-text-muted);
}

@media (max-width: 640px) {
    .cd-errata-modal {
        width: 100vw; max-height: 100vh; height: 100vh;
        border-radius: 0;
    }
    .cd-errata-modal-header { padding: 14px 16px; }
    .cd-errata-modal-body { padding: 12px 16px 20px; }
    .cd-errata-table-wrap > .cd-errata-table { display: none; }
    .cd-errata-mobile { display: block; }
    .cd-errata-form-row { flex-direction: column; }
    .cd-errata-form-row input,
    .cd-errata-form-row textarea { width: 100% !important; }
}

/* ── Exam Calendar ── */
.cd-calendar-section {
    margin-top: 20px;
    border: 1px solid var(--cd-border);
    border-radius: 14px;
    background: var(--cd-card);
    padding: 16px;
}
.cd-cal-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--cd-border);
}
.cd-cal-title-row h3 {
    font-size: 0.95rem;
    font-weight: 700;
}
.cd-cal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 12px;
}
.cd-cal-nav {
    background: none;
    border: 1px solid var(--cd-border);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
    color: var(--cd-text);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cd-cal-nav:hover { background: var(--cd-primary-soft); }
.cd-cal-month {
    font-size: 1rem;
    font-weight: 700;
    min-width: 100px;
    text-align: center;
}
.cd-cal-dow-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
.cd-cal-dow {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 0 8px;
    color: var(--cd-text-muted);
}
.cd-cal-dow.sun { color: var(--cd-danger); }
.cd-cal-dow.sat { color: #2d6bbf; }
.cd-cal-week {
    border-top: 1px solid #f0ece5;
}
.cd-cal-dates {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
.cd-cal-cell {
    text-align: center;
    padding: 6px 0 2px;
}
.cd-cal-date {
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
    width: 26px;
    height: 26px;
    line-height: 26px;
    border-radius: 50%;
}
.cd-cal-date.sun { color: var(--cd-danger); }
.cd-cal-date.sat { color: #2d6bbf; }
.cd-cal-date.other { color: #ccc; }
.cd-cal-date.today {
    background: var(--cd-primary);
    color: #fff;
    font-weight: 600;
}
.cd-cal-events {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 4px 0 8px;
}
.cd-cal-bar {
    height: 20px;
    border-radius: 4px;
    padding: 0 6px;
    font-size: 10px;
    font-weight: 500;
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    margin: 1px 1px;
    transition: filter 0.15s;
}
.cd-cal-bar:hover { filter: brightness(0.9); }
.cd-cal-popup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 99;
    display: none;
}
.cd-cal-popup-overlay.active { display: block; }
.cd-cal-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--cd-card);
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    z-index: 100;
    max-width: 340px;
    width: 90%;
    display: none;
}
.cd-cal-popup.active { display: block; }
.cd-cal-popup-close {
    position: absolute;
    top: 12px; right: 14px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--cd-text-muted);
}
.cd-cal-popup-color {
    width: 10px; height: 10px;
    border-radius: 3px;
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
}
.cd-cal-popup-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.cd-cal-popup-date {
    font-size: 0.82rem;
    color: var(--cd-text-muted);
    margin-bottom: 10px;
}
.cd-cal-popup-memo {
    font-size: 0.85rem;
    background: var(--cd-card-soft);
    border: 1px solid var(--cd-border);
    border-radius: 8px;
    padding: 10px 12px;
    line-height: 1.5;
}

@media (max-width: 480px) {
    .cd-cal-cell { padding: 4px 0 1px; }
    .cd-cal-date { font-size: 12px; width: 22px; height: 22px; line-height: 22px; }
    .cd-cal-bar { font-size: 9px; height: 18px; line-height: 18px; padding: 0 4px; }
    .cd-calendar-section { padding: 12px 8px; }
}
