/* ===========================================
   LANGUAGES & CUSTOM SECTION POPUPS
   STRICTLY SCOPED - All styles ONLY apply inside popups
   =========================================== */

/* ── Popup shell (full-screen fixed layer) ── */
#languagesPopup,
#customSectionPopup {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Show state */
#languagesPopup[style*="display: block"],
#languagesPopup[style*="display:block"],
#customSectionPopup[style*="display: block"],
#customSectionPopup[style*="display:block"] {
    display: flex !important;
}

/* ── Overlay ──────────────────────────────── */
#languagesPopup .skills-popup-overlay,
#customSectionPopup .skills-popup-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.5) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 99999 !important;
    padding: 24px !important;
    box-sizing: border-box !important;
    animation: lcFadeIn 0.2s ease !important;
    cursor: pointer !important;
}

/* ── Card ─────────────────────────────────── */
#languagesPopup .skills-popup-card,
#customSectionPopup .skills-popup-card {
    all: unset !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    width: 520px !important;
    max-width: calc(100vw - 32px) !important;
    max-height: calc(100vh - 48px) !important;
    background: #ffffff !important;
    border-radius: 18px !important;
    border: 1px solid #e8ecf0 !important;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.06), 0 20px 48px rgba(0,0,0,0.12) !important;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif !important;
    color: #0f172a !important;
    cursor: default !important;
    animation: lcSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    overflow: hidden !important;
}

/* ── Card header ──────────────────────────── */
#languagesPopup .lc-popup-header,
#customSectionPopup .lc-popup-header {
    padding: 24px 24px 20px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    flex-shrink: 0 !important;
}

#languagesPopup .skills-popup-card h3,
#customSectionPopup .skills-popup-card h3 {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 !important;
    padding: 24px 52px 0 24px !important;
    letter-spacing: -0.025em !important;
    line-height: 1.25 !important;
    background: none !important;
    border: none !important;
    flex-shrink: 0 !important;
}

/* ── Close button ─────────────────────────── */
#languagesPopup .close-popup-btn,
#customSectionPopup .close-popup-btn {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.15s, border-color 0.15s !important;
    font-size: 0 !important;
    color: transparent !important;
    z-index: 10 !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}

#languagesPopup .close-popup-btn::before,
#customSectionPopup .close-popup-btn::before {
    content: '✕' !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #64748b !important;
    line-height: 1 !important;
    display: block !important;
}

#languagesPopup .close-popup-btn:hover,
#customSectionPopup .close-popup-btn:hover {
    background: #fee2e2 !important;
    border-color: #fecaca !important;
}

#languagesPopup .close-popup-btn:hover::before,
#customSectionPopup .close-popup-btn:hover::before {
    color: #ef4444 !important;
}

/* ── Scrollable body ──────────────────────── */
#languagesPopup .popup-content,
#customSectionPopup .popup-content {
    flex: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 20px 24px 4px !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
}

#languagesPopup .popup-content::-webkit-scrollbar,
#customSectionPopup .popup-content::-webkit-scrollbar {
    width: 4px;
}

#languagesPopup .popup-content::-webkit-scrollbar-track,
#customSectionPopup .popup-content::-webkit-scrollbar-track {
    background: transparent;
}

#languagesPopup .popup-content::-webkit-scrollbar-thumb,
#customSectionPopup .popup-content::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}

/* ── Field labels (scoped to popup) ───────── */
#languagesPopup .popup-content label,
#customSectionPopup .popup-content label,
#languagesPopup .popup-content h4,
#customSectionPopup .popup-content h4,
#languagesPopup .languages-search-section > label,
#languagesPopup .languages-list-section > h4,
#languagesPopup .selected-languages-section > h4,
#customSectionPopup .languages-search-section > label,
#customSectionPopup .languages-list-section > h4,
#customSectionPopup .selected-languages-section > h4 {
    display: block !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    margin: 0 0 6px 0 !important;
    letter-spacing: 0.02em !important;
    text-transform: uppercase !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
}

/* ── Shared input style (scoped to popup) ─── */
#languagesPopup .languages-search-section input,
#customSectionPopup #customSectionTitle,
#customSectionPopup #customSectionContent {
    display: block !important;
    width: 100% !important;
    padding: 10px 13px !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    color: #0f172a !important;
    background: #f8fafc !important;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s !important;
    box-sizing: border-box !important;
    line-height: 1.5 !important;
    outline: none !important;
}

#languagesPopup .languages-search-section input:focus,
#customSectionPopup #customSectionTitle:focus,
#customSectionPopup #customSectionContent:focus {
    border-color: #10b981 !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

#languagesPopup .languages-search-section input::placeholder,
#customSectionPopup #customSectionTitle::placeholder,
#customSectionPopup #customSectionContent::placeholder {
    color: #c0c9d4 !important;
}

#customSectionPopup #customSectionContent {
    min-height: 120px !important;
    resize: vertical !important;
}

#languagesPopup .char-count,
#customSectionPopup .char-count {
    font-size: 11.5px !important;
    color: #94a3b8 !important;
    text-align: right !important;
    margin-top: 4px !important;
}

/* ── Action bar ───────────────────────────── */
#languagesPopup .popup-actions,
#customSectionPopup .action-buttons {
    display: flex !important;
    gap: 10px !important;
    padding: 16px 24px 20px !important;
    border-top: 1px solid #f1f5f9 !important;
    background: #fff !important;
    border-radius: 0 0 18px 18px !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}
/* Custom section — cancel + add */
#customSectionPopup #cancelCustomSectionBtn {
    flex: 1 !important;
    padding: 12px 20px !important;
    background: #fff !important;
    color: #475569 !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    transition: all 0.15s !important;
}

#customSectionPopup #cancelCustomSectionBtn:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

#customSectionPopup #addCustomSectionBtn {
    flex: 2 !important;
    padding: 12px 24px !important;
    background: #0f172a !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    transition: background 0.15s !important;
    letter-spacing: -0.01em !important;
}

#customSectionPopup #addCustomSectionBtn:hover:not(:disabled) {
    background: #1e293b !important;
}

#customSectionPopup #addCustomSectionBtn:disabled {
    background: #e2e8f0 !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
}

/* ── Resume list — language items (scoped to popup) ── */
#languagesPopup .language-item,
#customSectionPopup .language-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 9px !important;
    padding: 10px 14px !important;
    margin-bottom: 8px !important;
    box-sizing: border-box !important;
    min-height: 44px !important;
    width: 100% !important;
    transition: border-color 0.15s !important;
}

#languagesPopup .language-item:hover,
#customSectionPopup .language-item:hover {
    border-color: #10b981 !important;
}

#languagesPopup .language-item-name,
#customSectionPopup .language-item-name {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    flex: 1 !important;
    min-width: 0 !important;
}

#languagesPopup .language-item-actions,
#customSectionPopup .language-item-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
}

#languagesPopup .language-item-proficiency,
#customSectionPopup .language-item-proficiency {
    height: 32px !important;
    padding: 0 8px !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    color: #475569 !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 7px !important;
    cursor: pointer !important;
    outline: none !important;
    appearance: auto !important;
    -webkit-appearance: auto !important;
    max-width: 130px !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
    transition: border-color 0.15s !important;
}

#languagesPopup .language-item-proficiency:focus,
#customSectionPopup .language-item-proficiency:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1) !important;
}

#languagesPopup .language-item-remove,
#customSectionPopup .language-item-remove {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 7px !important;
    color: #94a3b8 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    padding: 0 !important;
    transition: all 0.15s !important;
    flex-shrink: 0 !important;
}

#languagesPopup .language-item-remove:hover,
#customSectionPopup .language-item-remove:hover {
    background: #fee2e2 !important;
    border-color: #fecaca !important;
    color: #ef4444 !important;
}

/* ── Resume list — custom section items (scoped to popup) ── */
#customSectionPopup .custom-section-item {
    position: relative !important;
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 9px !important;
    padding: 12px 14px !important;
    margin-bottom: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    transition: border-color 0.15s !important;
}

#customSectionPopup .custom-section-item:hover {
    border-color: #10b981 !important;
}

#customSectionPopup .custom-section-item-title {
    font-size: 13.5px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    padding-right: 90px !important;
    line-height: 1.4 !important;
}

#customSectionPopup .custom-section-item-content {
    font-size: 12.5px !important;
    color: #64748b !important;
    line-height: 1.5 !important;
    padding-right: 90px !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
}

#customSectionPopup .custom-section-item-actions {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    display: flex !important;
    gap: 5px !important;
    align-items: center !important;
}

#customSectionPopup .custom-section-edit-btn {
    height: 28px !important;
    padding: 0 10px !important;
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 7px !important;
    color: #475569 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    transition: all 0.15s !important;
    white-space: nowrap !important;
    box-shadow: none !important;
    transform: none !important;
}

#customSectionPopup .custom-section-edit-btn:hover {
    background: #dbeafe !important;
    border-color: #bfdbfe !important;
    color: #1d4ed8 !important;
    transform: none !important;
}

#customSectionPopup .custom-section-remove-btn {
    width: 28px !important;
    height: 28px !important;
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 7px !important;
    color: #94a3b8 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    padding: 0 !important;
    transition: all 0.15s !important;
    box-shadow: none !important;
}

#customSectionPopup .custom-section-remove-btn:hover {
    background: #fee2e2 !important;
    border-color: #fecaca !important;
    color: #ef4444 !important;
}

/* ── Empty states (scoped to popup) ─────────── */
#languagesPopup .languages-list:empty::before,
#customSectionPopup .custom-sections-list:empty::before {
    content: 'Nothing added yet.';
    display: block;
    padding: 14px 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    font-style: italic;
    background: #fafafa;
    border: 1px dashed #e2e8f0;
    border-radius: 9px;
    margin-bottom: 10px;
}

/* ── Animations ───────────────────────────── */
@keyframes lcFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes lcSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Mobile ───────────────────────────────── */
@media (max-width: 600px) {
    /* Keep overlay centered — never bottom-sheet */
    #languagesPopup .skills-popup-overlay,
    #customSectionPopup .skills-popup-overlay {
        align-items: center !important;
        justify-content: center !important;
        padding: 16px !important;
    }

    #languagesPopup .skills-popup-card,
    #customSectionPopup .skills-popup-card {
        width: calc(100vw - 32px) !important;
        max-width: calc(100vw - 32px) !important;
        max-height: calc(100vh - 48px) !important;
        border-radius: 18px !important;
        margin: auto !important;
    }

    #languagesPopup .skills-popup-card h3,
    #customSectionPopup .skills-popup-card h3 {
        padding: 22px 52px 0 20px !important;
        font-size: 16px !important;
    }

    #languagesPopup .popup-content,
    #customSectionPopup .popup-content {
        padding: 16px 20px 4px !important;
    }

    #languagesPopup .popup-actions,
    #customSectionPopup .action-buttons {
        padding: 14px 20px 20px !important;
        border-radius: 0 0 18px 18px !important;
    }

    #languagesPopup .languages-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        max-height: 200px !important;
    }

    #languagesPopup .custom-language-section .form-group {
        flex-direction: column !important;
    }
}



/* ── Editor-side language card (buildLanguageCard) ───────────────────────────
   Scoped to #languages-list so it never touches .resume-page or .preview-panel
   ─────────────────────────────────────────────────────────────────────────── */

   #languages-list .language-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 9px 12px !important;
    background: #f8fafc !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 10px !important;
    margin-bottom: 7px !important;
    box-sizing: border-box !important;
    transition: border-color 0.15s !important;
}

#languages-list .language-item:hover {
    border-color: #10b981 !important;
}

/* Avatar circle */
#languages-list .lc-avatar {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    font-family: 'Inter', sans-serif !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
}

/* Language name */
#languages-list .lc-name {
    flex: 1 !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Actions wrapper */
#languages-list .lc-actions {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    flex-shrink: 0 !important;
}

/* Proficiency dropdown */
#languages-list .language-item-proficiency {
    height: 30px !important;
    padding: 0 7px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #475569 !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 7px !important;
    cursor: pointer !important;
    outline: none !important;
    appearance: auto !important;
    -webkit-appearance: auto !important;
    max-width: 128px !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
    transition: border-color 0.15s !important;
}

#languages-list .language-item-proficiency:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1) !important;
}

/* Remove button */
#languages-list .language-item-remove {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 7px !important;
    color: #94a3b8 !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    cursor: pointer !important;
    padding: 0 !important;
    line-height: 1 !important;
    transition: all 0.15s !important;
    flex-shrink: 0 !important;
}

#languages-list .language-item-remove:hover {
    background: #fee2e2 !important;
    border-color: #fecaca !important;
    color: #ef4444 !important;
}


/* =============================================================
   CUSTOM SECTIONS — EDITOR PANEL ONLY
   Add to the bottom of languages-custom-sections.css
   Scoped to #custom-sections-list — never touches .resume-page
   ============================================================= */

/* ── Wrapper card ─────────────────────────────────────────────── */
#custom-sections-list .cs-item {
    position: relative;
    background: #f8fafc;
    border: 0.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    box-sizing: border-box;
    transition: border-color .15s;
  }
  #custom-sections-list .cs-item:hover { border-color: #10b981; }
  
  /* ── Title & body ─────────────────────────────────────────────── */
  #custom-sections-list .cs-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #0f172a;
    padding-right: 88px;
    margin-bottom: 3px;
    line-height: 1.4;
  }
  #custom-sections-list .cs-body {
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.5;
    padding-right: 88px;
    white-space: pre-wrap;
    word-break: break-word;
  }
  
  /* ── Action buttons (top-right) ───────────────────────────────── */
  #custom-sections-list .cs-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    align-items: center;
  }
  #custom-sections-list .cs-edit-btn {
    height: 26px;
    padding: 0 10px;
    background: #fff;
    border: 0.5px solid #e2e8f0;
    border-radius: 7px;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all .15s;
  }
  #custom-sections-list .cs-edit-btn:hover {
    background: #dbeafe;
    border-color: #bfdbfe;
    color: #1d4ed8;
  }
  #custom-sections-list .cs-del-btn {
    width: 26px;
    height: 26px;
    background: #fff;
    border: 0.5px solid #e2e8f0;
    border-radius: 7px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: all .15s;
  }
  #custom-sections-list .cs-del-btn:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #ef4444;
  }
  
  /* ── Inline edit form (hidden by default) ─────────────────────── */
  #custom-sections-list .cs-inline-form {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 0.5px solid #e5e7eb;
  }
  #custom-sections-list .cs-inline-form.open {
    display: flex;
  }
  #custom-sections-list .cs-form-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 5px;
  }
  #custom-sections-list .cs-form-input,
  #custom-sections-list .cs-form-textarea {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    font-size: 13.5px;
    font-family: inherit;
    color: #0f172a;
    background: #fff;
    box-sizing: border-box;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
  }
  #custom-sections-list .cs-form-input:focus,
  #custom-sections-list .cs-form-textarea:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16,185,129,.1);
  }
  #custom-sections-list .cs-form-textarea {
    resize: vertical;
    min-height: 90px;
    line-height: 1.6;
  }
  #custom-sections-list .cs-form-row {
    display: flex;
    gap: 8px;
  }
  #custom-sections-list .cs-btn-cancel {
    flex: 1;
    padding: 9px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: #475569;
    cursor: pointer;
    transition: all .15s;
  }
  #custom-sections-list .cs-btn-cancel:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
  }
  #custom-sections-list .cs-btn-save {
    flex: 2;
    padding: 9px;
    background: #0f172a;
    border: none;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    cursor: pointer;
    transition: background .15s;
  }
  #custom-sections-list .cs-btn-save:hover { background: #1e293b; }
  #custom-sections-list .cs-btn-save:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
  }
  
  /* ── "Add" new section inline form ───────────────────────────── */
  #cs-new-form {
    display: none;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    background: #f0fdf4;
    border: 1.5px solid #a7f3d0;
    border-radius: 10px;
    margin-bottom: 8px;
    box-sizing: border-box;
  }
  #cs-new-form.open { display: flex; }
  #cs-new-form label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 5px;
  }
  #cs-new-form input,
  #cs-new-form textarea {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    font-size: 13.5px;
    font-family: inherit;
    color: #0f172a;
    background: #fff;
    box-sizing: border-box;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
  }
  #cs-new-form input:focus,
  #cs-new-form textarea:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16,185,129,.1);
  }
  #cs-new-form textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
  #cs-new-form .cs-form-row { display: flex; gap: 8px; }
  #cs-new-form .cs-btn-cancel {
    flex: 1; padding: 9px;
    background: #fff; border: 1.5px solid #e2e8f0; border-radius: 9px;
    font-size: 13px; font-weight: 600; font-family: inherit; color: #475569;
    cursor: pointer; transition: all .15s;
  }
  #cs-new-form .cs-btn-cancel:hover { background: #f8fafc; border-color: #94a3b8; color: #0f172a; }
  #cs-new-form .cs-btn-save {
    flex: 2; padding: 9px;
    background: #0f172a; border: none; border-radius: 9px;
    font-size: 13px; font-weight: 600; font-family: inherit; color: #fff;
    cursor: pointer; transition: background .15s;
  }
  #cs-new-form .cs-btn-save:hover { background: #1e293b; }
  #cs-new-form .cs-btn-save:disabled { background: #e2e8f0; color: #94a3b8; cursor: not-allowed; }
  
  /* ── Empty state ──────────────────────────────────────────────── */
  #custom-sections-list:empty::before {
    content: 'No custom sections yet.';
    display: block;
    padding: 14px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    font-style: italic;
    border: 1px dashed #e2e8f0;
    border-radius: 9px;
    margin-bottom: 8px;
  }