/* =========================================
   JobCV — Resume Builder v2
   Template styles + Builder UI
   ========================================= */

/* ---- Share Toggle Switch ---- */
.share-toggle { position:relative; display:inline-block; width:44px; height:24px; flex-shrink:0; }
.share-toggle input { opacity:0; width:0; height:0; }
.share-slider {
    position:absolute; cursor:pointer; inset:0;
    background:#d1d5db; border-radius:24px; transition:background .2s;
}
.share-slider::before {
    content:''; position:absolute; width:18px; height:18px;
    left:3px; top:3px; background:#fff; border-radius:50%;
    transition:transform .2s; box-shadow:0 1px 3px rgba(0,0,0,.2);
}
.share-toggle input:checked + .share-slider { background:#10b981; }
.share-toggle input:checked + .share-slider::before { transform:translateX(20px); }

/* ---- Resume Score Widget ---- */
.score-wrap { position: relative; }
.score-btn {
    background: none; border: 1.5px solid #e5e7eb; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%; position: relative;
    transition: border-color 0.2s, background 0.2s;
}
.score-btn:hover { border-color: #6366f1; background: #f5f3ff; }
.score-ring { transform: rotate(-90deg); display: block; }
.score-ring-bg  { fill: none; stroke: #e5e7eb; stroke-width: 3; }
.score-ring-fill {
    fill: none; stroke: #10b981; stroke-width: 3; stroke-linecap: round;
    stroke-dasharray: 81.68; stroke-dashoffset: 81.68;
    transition: stroke-dashoffset 0.6s ease, stroke 0.4s ease;
}
.score-num {
    position: absolute; font-size: 8.5px; font-weight: 800; color: #374151;
    line-height: 1; pointer-events: none;
}
.score-panel {
    display: none; position: fixed;
    width: 264px; background: white; border: 1px solid #e5e7eb;
    border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,0.18);
    z-index: 9999; padding: 16px;
    animation: dropFadeIn 0.15s ease;
}
.score-panel.open { display: block; }
.score-panel-hdr {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px; font-size: 0.85rem; font-weight: 700; color: #111827;
}
.score-bar-wrap { background: #f3f4f6; border-radius: 99px; height: 7px; margin-bottom: 6px; overflow: hidden; }
.score-bar { height: 100%; border-radius: 99px; background: #10b981; transition: width 0.6s ease, background 0.4s ease; width: 0%; }
.score-grade { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }
.score-checks { display: flex; flex-direction: column; gap: 5px; max-height: 230px; overflow-y: auto; }
.score-check { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; }
.score-check-icon {
    width: 17px; height: 17px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 9px; font-weight: 700; flex-shrink: 0;
}
.score-check.done .score-check-icon { background: #d1fae5; color: #059669; }
.score-check.miss .score-check-icon { background: #f3f4f6; color: #9ca3af; }
.score-check.done .score-check-text { color: #374151; }
.score-check.miss .score-check-text { color: #9ca3af; }
.score-check-pts { margin-left: auto; font-size: 0.68rem; color: #d1d5db; font-weight: 600; flex-shrink: 0; }
.score-check.done .score-check-pts { color: #10b981; }
.score-footer { margin-top: 10px; font-size: 0.72rem; color: #9ca3af; border-top: 1px solid #f3f4f6; padding-top: 8px; line-height: 1.5; }

/* ---- Language / Settings Dropdown ---- */
/* ---- Download Menu ---- */
.download-wrap { position: relative; }
.download-menu {
    position: fixed;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.13);
    z-index: 9999;
    padding: 6px 0;
    min-width: 160px;
    animation: dropFadeIn 0.15s ease;
}
.download-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s;
}
.download-menu-item:hover { background: #f3f4f6; }

.lang-dropdown-wrap {
    position: relative;
}

.lang-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    transition: all 0.2s;
    white-space: nowrap;
}
.lang-dropdown-btn:hover { border-color: #6366f1; color: #6366f1; background: #f5f3ff; }
.lang-dropdown-btn.open  { border-color: #6366f1; color: #6366f1; background: #f5f3ff; }

.lang-chevron { font-size: 0.65rem; color: #9ca3af; transition: transform 0.2s; }
.lang-dropdown-btn.open .lang-chevron { transform: rotate(180deg); }

.lang-dropdown-menu {
    display: none;
    position: fixed;
    width: 240px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    z-index: 9999;
    padding: 8px 0 6px;
    animation: dropFadeIn 0.15s ease;
}
.lang-dropdown-menu.open { display: block; }

@keyframes dropFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Compact two-column grid for Date Format + Page Size */
.lang-compact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 0 10px 6px;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 4px;
}
.lang-compact-col {}
.lang-compact-col .lang-section-title {
    padding: 4px 4px 4px;
}
.lang-compact-col .lang-option {
    padding: 4px 4px;
    font-size: 0.8rem;
    gap: 5px;
}

.lang-section-title {
    padding: 4px 14px 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
}

/* Scrollable language list — 4 items visible */
.lang-list-scroll {
    max-height: 164px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}
.lang-list-scroll::-webkit-scrollbar { width: 4px; }
.lang-list-scroll::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.85rem;
    color: #374151;
}
.lang-option:hover { background: #f9fafb; }
.lang-option input[type="radio"] { accent-color: #6366f1; flex-shrink: 0; }
.lang-option input[type="radio"]:checked + .lang-option-label { color: #6366f1; font-weight: 600; }
.lang-option input[type="radio"]:checked ~ .lang-option-label { color: #6366f1; font-weight: 600; }

.lang-flag  { font-size: 1rem; flex-shrink: 0; }
.lang-flag-img {
    width: 20px !important;
    height: 15px !important;
    flex-shrink: 0;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.lang-code-tag {
    font-size: 0.72rem;
    font-weight: 700;
    color: #9ca3af;
    min-width: 24px;
}
.lang-option-lang input[type="radio"]:checked ~ .lang-code-tag { color: #6366f1; }
.lang-option-label { flex: 1; }

/* ---- Builder Layout ---- */
.builder-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.builder-topbar {
    height: 52px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    flex-shrink: 0;
    z-index: 50;
}

.builder-topbar-title {
    flex: 1;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
#resumeTitleSpan {
    outline: none;
    border-radius: 6px;
    padding: 2px 6px;
    cursor: text;
    transition: background 0.15s;
    min-width: 60px;
    max-width: 260px;
}
#resumeTitleSpan:hover { background: #f3f4f6; }
#resumeTitleSpan:focus { background: #eff6ff; box-shadow: 0 0 0 2px #bfdbfe; }
.title-edit-hint {
    font-size: 0.7rem;
    color: #d1d5db;
    cursor: default;
    transition: color 0.15s;
}
.builder-topbar-title:hover .title-edit-hint { color: #6366f1; }

/* Photo shape selector */
.photo-shape-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0 12px;
    font-size: 0.78rem;
}
.photo-shape-label { color: #6b7280; font-weight: 500; margin-right: 2px; }
.photo-shape-btn {
    padding: 4px 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 20px;
    background: white;
    color: #6b7280;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}
.photo-shape-btn:hover { border-color: #6366f1; color: #6366f1; }
.photo-shape-btn.active { border-color: #6366f1; background: #eff6ff; color: #6366f1; font-weight: 600; }

.builder-workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ---- Resizable divider ---- */
.builder-divider {
    width: 5px;
    background: #e5e7eb;
    cursor: col-resize;
    flex-shrink: 0;
    position: relative;
    transition: background 0.15s;
    z-index: 10;
}
.builder-divider:hover,
.builder-divider.dragging {
    background: #6366f1;
}
.builder-divider::after {
    content: '⋮';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #9ca3af;
    font-size: 14px;
    pointer-events: none;
    letter-spacing: -2px;
}
.builder-divider:hover::after,
.builder-divider.dragging::after {
    color: white;
}

/* ---- Left Form Panel ---- */
.builder-form-panel {
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overflow: hidden;
}

.builder-import-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.import-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    background: none;
    border: none;
    border-right: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s;
}
.import-btn:last-child { border-right: none; }
.import-btn:hover { background: #f9fafb; color: #1f2937; }
.import-btn .import-icon { font-size: 1rem; }
.topbar-demo-btn { color: #7c3aed !important; font-size: 0.78rem !important; }
.topbar-demo-btn:hover { background: #f5f3ff !important; }
#undoBtn:disabled, #redoBtn:disabled { opacity: 0.35; cursor: not-allowed; }
#undoBtn:not(:disabled), #redoBtn:not(:disabled) { color: #374151; }

.builder-sections-nav-wrap {
    position: relative;
    flex-shrink: 0;
    border-bottom: 1px solid #e5e7eb;
}
.builder-sections-nav-wrap::after {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 32px;
    background: linear-gradient(to right, transparent, white);
    pointer-events: none;
    z-index: 1;
}
.builder-sections-nav {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: none;
    flex-shrink: 0;
}
.builder-sections-nav::-webkit-scrollbar { display: none; }

.section-nav-btn {
    padding: 9px 9px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    color: #9ca3af;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
    cursor: pointer;
    transition: all 0.2s;
}
.section-nav-btn.active { color: #2563eb; border-bottom-color: #2563eb; }
.section-nav-btn:hover:not(.active) { color: #374151; }

.builder-form-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 24px 24px 100px;
}

.form-section { display: none; }
.form-section.active { display: block; }

.form-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9ca3af;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sec-title-editable {
    cursor: text;
    border-radius: 4px;
    padding: 1px 4px;
    outline: none;
    transition: background 0.15s, color 0.15s;
}
.sec-title-editable:hover {
    background: #f3f4f6;
    color: #374151;
}
.sec-title-editable:focus {
    background: #eff6ff;
    color: #1d4ed8;
    box-shadow: 0 0 0 2px #bfdbfe;
}

.sec-title-reset {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    color: #9ca3af;
    padding: 2px 5px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
    margin-left: 2px;
}
.form-section-title:hover .sec-title-reset { opacity: 1; }
.sec-title-reset:hover { color: #fff; background: #6366f1; }

/* Photo upload */
.photo-upload-area {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 10px;
    border: 2px dashed #e5e7eb;
    cursor: pointer;
    transition: all 0.2s;
}
.photo-upload-area:hover { border-color: #2563eb; background: #eff6ff; }

.photo-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #9ca3af;
    flex-shrink: 0;
    overflow: hidden;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

.photo-upload-text { font-size: 0.8rem; color: #6b7280; line-height: 1.5; }
.photo-upload-text strong { color: #374151; display: block; }

/* Optional fields grid */
.optional-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.add-field-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1.5px dashed #d1d5db;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    background: none;
    cursor: pointer;
    transition: all 0.2s;
}
.add-field-btn:hover { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.add-field-btn.active { border-color: #2563eb; color: #2563eb; background: #eff6ff; border-style: solid; }

.optional-field-row { display: none; }
.optional-field-row.visible { display: block; }

/* Experience items */
.exp-entry {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
}

.exp-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
}

.exp-entry-header:hover { background: #f3f4f6; }

.exp-entry-title-row { display: flex; align-items: center; gap: 8px; }
.exp-entry-drag { color: #d1d5db; font-size: 0.9rem; cursor: grab; user-select: none; padding: 2px 4px; }
.exp-entry-drag:active { cursor: grabbing; }
.sortable-ghost { opacity: 0.4; background: #eff6ff !important; border: 2px dashed #93c5fd !important; border-radius: 10px; }
.sortable-chosen { box-shadow: 0 4px 16px rgba(99,102,241,0.18); }

/* Click-to-edit section titles in preview */
.resume-paper .r-editable,
.resume-paper h1[data-sec] {
    cursor: pointer;
    position: relative;
}
.resume-paper .r-editable:hover,
.resume-paper h1[data-sec]:hover {
    color: var(--accent) !important;
}
.resume-paper .r-editable::after {
    content: ' ✎';
    font-size: 0.65em;
    opacity: 0;
    transition: opacity 0.15s;
    font-style: normal;
}
.resume-paper .r-editable:hover::after {
    opacity: 0.7;
}
@media print {
    .resume-paper .r-editable { cursor: default; }
    .resume-paper .r-editable::after { display: none; }
}
.exp-entry-label { font-weight: 600; font-size: 0.85rem; color: #374151; }
.exp-entry-sub { font-size: 0.75rem; color: #9ca3af; }

.exp-entry-actions { display: flex; gap: 4px; }
.exp-entry-actions button {
    width: 28px; height: 28px;
    border-radius: 6px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    color: #9ca3af;
}
.exp-entry-actions button:hover { background: #e5e7eb; color: #374151; }
.exp-entry-actions .btn-del:hover { background: #fee2e2; color: #dc2626; }

.exp-entry-body {
    padding: 0 16px 16px;
    display: none;
}
.exp-entry.open .exp-entry-body { display: block; }
.exp-entry-chevron { transition: transform 0.2s; color: #9ca3af; font-size: 0.8rem; }
.exp-entry.open .exp-entry-chevron { transform: rotate(180deg); }

/* Language level */
.lang-level-picker {
    display: flex;
    gap: 4px;
}
.lang-level-dot {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    cursor: pointer;
    transition: all 0.2s;
}
.lang-level-dot.filled { background: #2563eb; border-color: #2563eb; }

/* ---- Right Preview Panel ---- */
.builder-preview-panel {
    background: #f3f4f6;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.preview-scroll {
    flex: 1;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 32px 24px 120px;
}

/* ---- Bottom Toolbar ---- */
.builder-bottom-toolbar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 4px;
    z-index: 20;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.toolbar-btn:hover { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.toolbar-btn.active { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.toolbar-btn-break:hover { border-color: #f97316 !important; color: #ea580c !important; background: #fff7ed !important; }

.toolbar-divider { width: 1px; height: 24px; background: #e5e7eb; margin: 0 4px; }

.toolbar-select {
    padding: 5px 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    background: white;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}
.toolbar-select:focus { border-color: #2563eb; }

.toolbar-color-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.toolbar-color-btn {
    width: 32px; height: 32px;
    border-radius: 8px;
    border: 1.5px solid #e5e7eb;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    padding: 4px;
    transition: border-color 0.2s;
}
.toolbar-color-btn:hover { border-color: #2563eb; }

.color-swatch {
    width: 18px; height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}

.toolbar-spacer { flex: 1; }

/* ---- Template Panel ---- */
.template-panel {
    position: absolute;
    bottom: 52px;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 20px 16px 16px;
    display: none;
    z-index: 19;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.08);
}
.template-panel.open { display: block; }

/* ---- Color Presets ---- */
.color-presets-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid #f3f4f6;
    margin-top: 14px;
    flex-wrap: wrap;
}
.color-presets-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}
.color-presets-swatches {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}
.cp-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s, border-color 0.15s;
    outline: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.cp-swatch:hover { transform: scale(1.2); }
.cp-swatch.active {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.35);
    transform: scale(1.1);
}
.color-presets-hint {
    font-size: 0.72rem;
    color: #9ca3af;
    white-space: nowrap;
}

/* ---- Section Tip Box ---- */
.sec-tip-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 18px;
}
.sec-tip-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 7px;
}
.sec-tip-list {
    margin: 0;
    padding-left: 16px;
    list-style: disc;
}
.sec-tip-list li {
    font-size: 0.77rem;
    color: #78350f;
    line-height: 1.55;
    margin-bottom: 3px;
}
.sec-tip-list li:last-child { margin-bottom: 0; }
.sec-tip-list em { color: #6b7280; font-style: normal; font-weight: 500; }
.sec-tip-list strong { color: #92400e; }

.template-panel-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-bottom: 14px;
}

.template-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}

.tpl-thumb {
    flex-shrink: 0;
    width: 90px;
    cursor: pointer;
    transition: transform 0.2s;
}
.tpl-thumb:hover { transform: translateY(-2px); }

.tpl-thumb-card {
    width: 90px;
    height: 120px;
    border-radius: 6px;
    overflow: hidden;
    border: 2.5px solid #e5e7eb;
    transition: border-color 0.2s;
    position: relative;
    background: white;
}
.tpl-thumb.active .tpl-thumb-card { border-color: #2563eb; }
.tpl-thumb-card:hover { border-color: #93c5fd; }

.tpl-thumb-name {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: #6b7280;
    margin-top: 6px;
    transition: color 0.2s;
}
.tpl-thumb.active .tpl-thumb-name { color: #2563eb; }

/* Template thumbnail designs */
.tt-horizontal .tt-head { background: #2563eb; height: 30px; display: flex; align-items: center; padding: 0 6px; gap: 4px; }
.tt-horizontal .tt-head-circle { width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,0.3); flex-shrink: 0; }
.tt-horizontal .tt-head-lines { flex: 1; }
.tt-horizontal .tt-head-line { height: 4px; background: rgba(255,255,255,0.8); border-radius: 2px; margin-bottom: 2px; }
.tt-horizontal .tt-head-line.short { width: 60%; }
.tt-horizontal .tt-body { display: grid; grid-template-columns: 35px 1fr; gap: 4px; padding: 5px; }
.tt-horizontal .tt-col-line { height: 3px; background: #e5e7eb; border-radius: 2px; margin-bottom: 3px; }
.tt-horizontal .tt-col-line.accent { background: #bfdbfe; }

.tt-metro .tt-head { background: #111; height: 28px; display: flex; align-items: center; padding: 0 6px; }
.tt-metro .tt-head-line { height: 5px; background: white; border-radius: 2px; width: 70%; }
.tt-metro .tt-head-sub { height: 3px; background: #ef4444; border-radius: 2px; width: 40%; margin-top: 3px; }
.tt-metro .tt-body { padding: 5px 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.tt-metro .tt-line { height: 3px; background: #e5e7eb; border-radius: 2px; margin-bottom: 3px; }
.tt-metro .tt-line.dark { background: #374151; height: 4px; }

.tt-elegant .tt-sidebar { background: #1e293b; width: 28px; position: absolute; left: 0; top: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; padding-top: 8px; gap: 3px; }
.tt-elegant .tt-sidebar-circle { width: 16px; height: 16px; border-radius: 50%; background: rgba(255,255,255,0.2); }
.tt-elegant .tt-sidebar-line { width: 12px; height: 2px; background: rgba(255,255,255,0.3); border-radius: 1px; }
.tt-elegant .tt-main { margin-left: 28px; padding: 6px; }
.tt-elegant .tt-line { height: 3px; background: #e5e7eb; border-radius: 2px; margin-bottom: 3px; }
.tt-elegant .tt-line.dark { background: #374151; }

.tt-simple .tt-head { padding: 8px 6px 4px; border-bottom: 2px solid #111; margin-bottom: 5px; }
.tt-simple .tt-name { height: 5px; background: #111; border-radius: 2px; width: 60%; margin-bottom: 3px; }
.tt-simple .tt-sub { height: 3px; background: #9ca3af; border-radius: 2px; width: 40%; }
.tt-simple .tt-body { padding: 0 6px; }
.tt-simple .tt-line { height: 2px; background: #e5e7eb; border-radius: 1px; margin-bottom: 3px; }
.tt-simple .tt-line.dark { background: #374151; height: 3px; }

.tt-vertical .tt-sidebar { background: #be123c; width: 30px; position: absolute; left: 0; top: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; padding-top: 8px; gap: 3px; }
.tt-vertical .tt-sidebar-circle { width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,0.3); }
.tt-vertical .tt-sidebar-line { width: 14px; height: 2px; background: rgba(255,255,255,0.4); border-radius: 1px; }
.tt-vertical .tt-main { margin-left: 30px; padding: 6px; }
.tt-vertical .tt-line { height: 3px; background: #e5e7eb; border-radius: 2px; margin-bottom: 3px; }
.tt-vertical .tt-line.dark { background: #374151; }

.tt-classic .tt-head { background: #f3f4f6; padding: 6px; border-bottom: 1px solid #d1d5db; display: flex; gap: 5px; align-items: center; }
.tt-classic .tt-circle { width: 20px; height: 20px; border-radius: 50%; background: #9ca3af; flex-shrink: 0; }
.tt-classic .tt-head-info .tt-line { height: 3px; background: #374151; border-radius: 2px; margin-bottom: 2px; }
.tt-classic .tt-head-info .tt-line.gray { background: #9ca3af; }
.tt-classic .tt-body { padding: 5px 6px; }
.tt-classic .tt-line { height: 2px; background: #e5e7eb; border-radius: 1px; margin-bottom: 3px; }
.tt-classic .tt-line.dark { background: #374151; height: 3px; }

.tt-casual .tt-head { background: #059669; height: 28px; display: flex; align-items: center; padding: 0 6px; }
.tt-casual .tt-head-line { height: 4px; background: white; border-radius: 2px; width: 65%; }
.tt-casual .tt-body { padding: 5px 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.tt-casual .tt-line { height: 2px; background: #e5e7eb; border-radius: 1px; margin-bottom: 3px; }
.tt-casual .tt-line.accent { background: #a7f3d0; height: 3px; }
.tt-casual .tt-line.dark { background: #374151; }

.tt-modern .tt-head { background: #0f172a; height: 35px; padding: 0 6px; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.tt-modern .tt-head-line { height: 4px; background: rgba(255,255,255,0.9); border-radius: 2px; width: 70%; }
.tt-modern .tt-head-line.thin { height: 2px; background: rgba(255,255,255,0.4); width: 50%; }
.tt-modern .tt-body { padding: 5px 6px; display: grid; grid-template-columns: 35px 1fr; gap: 4px; }
.tt-modern .tt-col-line { height: 2px; background: #e5e7eb; border-radius: 1px; margin-bottom: 3px; }
.tt-modern .tt-col-line.accent { background: #fbbf24; }

/* ============================================
   RESUME PAPER TEMPLATES
   ============================================ */

.resume-paper {
    background: white;
    width: 620px;
    min-height: 877px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    border-radius: 2px;
    font-size: 11px;
    line-height: 1.5;
    color: #1a1a1a;
    overflow: hidden;
    position: relative;
    --accent: #2563eb;
    --accent-light: #eff6ff;
    --sidebar-bg: #1e293b;
    --sidebar-text: #e2e8f0;
}

.resume-photo {
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* ---- HORIZONTAL template ---- */
.resume-paper.tpl-horizontal .r-head {
    background: var(--accent);
    padding: 28px 32px;
    display: flex;
    align-items: center;
    gap: 20px;
    color: white;
}
.resume-paper.tpl-horizontal .r-head-info { flex: 1; }
.resume-paper.tpl-horizontal .r-head h1 { font-size: 2em; font-weight: 700; color: white; margin-bottom: 4px; letter-spacing: -0.02em; }
.resume-paper.tpl-horizontal .r-head .r-jobtitle { font-size: 1em; color: rgba(255,255,255,0.8); margin-bottom: 12px; }
.resume-paper.tpl-horizontal .r-head .r-contact { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.864em; color: rgba(255,255,255,0.85); }
.resume-paper.tpl-horizontal .r-head .r-contact span { display: flex; align-items: center; gap: 4px; }
.resume-paper.tpl-horizontal .r-photo { width: 72px; height: 72px; flex-shrink: 0; border: 3px solid rgba(255,255,255,0.4); }
.resume-paper.tpl-horizontal .r-body { display: grid; grid-template-columns: 180px 1fr; }
.resume-paper.tpl-horizontal .r-sidebar { background: #f8fafc; padding: 22px 18px; border-right: 1px solid #e2e8f0; }
.resume-paper.tpl-horizontal .r-main { padding: 22px 24px; }
.resume-paper.tpl-horizontal .r-section { margin-bottom: 20px; }
.resume-paper.tpl-horizontal .r-section-title { font-size: 0.818em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); border-bottom: 1.5px solid var(--accent); padding-bottom: 4px; margin-bottom: 10px; }
.resume-paper.tpl-horizontal .skill-bar { margin-bottom: 6px; }
.resume-paper.tpl-horizontal .skill-bar-label { font-size: 0.818em; font-weight: 600; color: #374151; margin-bottom: 2px; }
.resume-paper.tpl-horizontal .skill-bar-track { height: 3px; background: #e5e7eb; border-radius: 2px; }
.resume-paper.tpl-horizontal .skill-bar-fill { height: 3px; background: var(--accent); border-radius: 2px; }

/* ---- METRO template ---- */
.resume-paper.tpl-metro .r-head {
    background: #111827;
    padding: 24px 32px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.resume-paper.tpl-metro .r-head-left { flex: 1; }
.resume-paper.tpl-metro .r-head h1 { font-size: 2.182em; font-weight: 800; color: white; letter-spacing: -0.03em; text-transform: uppercase; }
.resume-paper.tpl-metro .r-head .r-jobtitle { font-size: 1em; color: var(--accent); font-weight: 600; margin-top: 2px; }
.resume-paper.tpl-metro .r-head .r-contact { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.818em; color: #9ca3af; margin-top: 10px; }
.resume-paper.tpl-metro .r-photo { width: 68px; height: 68px; border-radius: 4px; flex-shrink: 0; }
.resume-paper.tpl-metro .r-body { padding: 24px 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.resume-paper.tpl-metro .r-section { margin-bottom: 20px; }
.resume-paper.tpl-metro .r-section-title { font-size: 0.818em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: #111; background: #f3f4f6; padding: 4px 8px; margin-bottom: 10px; border-left: 3px solid var(--accent); }

/* ---- ELEGANT template ---- */
.resume-paper.tpl-elegant { display: grid; grid-template-columns: 180px 1fr; }
.resume-paper.tpl-elegant .r-sidebar { background: var(--sidebar-bg); padding: 28px 18px; color: white; }
.resume-paper.tpl-elegant .r-sidebar .r-photo { width: 80px; height: 80px; margin: 0 auto 16px; border: 3px solid rgba(255,255,255,0.2); }
.resume-paper.tpl-elegant .r-sidebar h1 { font-size: 1.273em; font-weight: 700; color: white; text-align: center; margin-bottom: 4px; }
.resume-paper.tpl-elegant .r-sidebar .r-jobtitle { font-size: 0.818em; color: rgba(255,255,255,0.6); text-align: center; margin-bottom: 20px; }
.resume-paper.tpl-elegant .r-sidebar .r-section-title { font-size: 0.727em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 4px; margin-bottom: 8px; }
.resume-paper.tpl-elegant .r-sidebar .r-contact-item { font-size: 0.773em; color: rgba(255,255,255,0.7); margin-bottom: 5px; display: flex; align-items: flex-start; gap: 5px; }
.resume-paper.tpl-elegant .r-main { padding: 28px 24px; }
.resume-paper.tpl-elegant .r-section { margin-bottom: 20px; }
.resume-paper.tpl-elegant .r-main .r-section-title { font-size: 0.818em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--sidebar-bg); border-bottom: 2px solid var(--accent); padding-bottom: 4px; margin-bottom: 10px; }

/* ---- SIMPLE template ---- */
.resume-paper.tpl-simple .r-head {
    padding: 32px 40px 20px;
    border-bottom: 2px solid #111;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.resume-paper.tpl-simple .r-head-info { flex: 1; }
.resume-paper.tpl-simple .r-head h1 { font-size: 2.364em; font-weight: 700; color: #111; letter-spacing: -0.03em; margin-bottom: 4px; }
.resume-paper.tpl-simple .r-head .r-jobtitle { font-size: 1em; color: #6b7280; }
.resume-paper.tpl-simple .r-head .r-contact { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.818em; color: #6b7280; margin-top: 8px; }
.resume-paper.tpl-simple .r-photo { width: 70px; height: 70px; border-radius: 4px; flex-shrink: 0; }
.resume-paper.tpl-simple .r-body { padding: 0 40px 32px; display: grid; grid-template-columns: 180px 1fr; gap: 28px; }
.resume-paper.tpl-simple .r-section { margin-bottom: 20px; }
.resume-paper.tpl-simple .r-section-title { font-size: 0.818em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: #111; border-bottom: 1.5px solid #111; padding-bottom: 4px; margin-bottom: 10px; }

/* ---- VERTICAL template ---- */
.resume-paper.tpl-vertical { display: grid; grid-template-columns: 190px 1fr; }
.resume-paper.tpl-vertical .r-sidebar { background: var(--accent); padding: 28px 16px; color: white; }
.resume-paper.tpl-vertical .r-sidebar .r-photo { width: 80px; height: 80px; margin: 0 auto 14px; border: 3px solid rgba(255,255,255,0.4); }
.resume-paper.tpl-vertical .r-sidebar h1 { font-size: 1.182em; font-weight: 700; color: white; text-align: center; margin-bottom: 3px; }
.resume-paper.tpl-vertical .r-sidebar .r-jobtitle { font-size: 0.818em; color: rgba(255,255,255,0.75); text-align: center; margin-bottom: 18px; }
.resume-paper.tpl-vertical .r-sidebar .r-section-title { font-size: 0.727em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.6); border-bottom: 1px solid rgba(255,255,255,0.2); padding-bottom: 3px; margin-bottom: 8px; }
.resume-paper.tpl-vertical .r-sidebar .r-contact-item { font-size: 0.727em; color: rgba(255,255,255,0.85); margin-bottom: 5px; }
.resume-paper.tpl-vertical .r-main { padding: 24px 20px; }
.resume-paper.tpl-vertical .r-section { margin-bottom: 18px; }
.resume-paper.tpl-vertical .r-main .r-section-title { font-size: 0.818em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); border-bottom: 1.5px solid var(--accent); padding-bottom: 4px; margin-bottom: 10px; }

/* ---- CLASSIC template ---- */
.resume-paper.tpl-classic .r-head {
    background: #f9fafb;
    padding: 24px 32px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 20px;
}
.resume-paper.tpl-classic .r-head-info { flex: 1; }
.resume-paper.tpl-classic .r-head h1 { font-size: 2em; font-weight: 700; color: #111; margin-bottom: 4px; }
.resume-paper.tpl-classic .r-head .r-jobtitle { font-size: 1em; color: #6b7280; }
.resume-paper.tpl-classic .r-head .r-contact { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.818em; color: #6b7280; margin-top: 8px; }
.resume-paper.tpl-classic .r-photo { width: 72px; height: 72px; border-radius: 4px; flex-shrink: 0; border: 1px solid #e5e7eb; }
.resume-paper.tpl-classic .r-body { padding: 22px 32px; display: grid; grid-template-columns: 175px 1fr; gap: 24px; }
.resume-paper.tpl-classic .r-section { margin-bottom: 18px; }
.resume-paper.tpl-classic .r-section-title { font-size: 0.818em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: #374151; border-bottom: 1.5px solid #d1d5db; padding-bottom: 4px; margin-bottom: 10px; }

/* ---- CASUAL template ---- */
.resume-paper.tpl-casual .r-head {
    background: var(--accent);
    padding: 26px 32px;
    color: white;
    display: flex;
    align-items: center;
    gap: 18px;
}
.resume-paper.tpl-casual .r-head-info { flex: 1; }
.resume-paper.tpl-casual .r-head h1 { font-size: 2em; font-weight: 700; color: white; margin-bottom: 3px; }
.resume-paper.tpl-casual .r-head .r-jobtitle { font-size: 0.909em; color: rgba(255,255,255,0.8); }
.resume-paper.tpl-casual .r-head .r-contact { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.818em; color: rgba(255,255,255,0.85); margin-top: 8px; }
.resume-paper.tpl-casual .r-photo { width: 68px; height: 68px; border: 3px solid rgba(255,255,255,0.4); flex-shrink: 0; }
.resume-paper.tpl-casual .r-body { padding: 22px 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.resume-paper.tpl-casual .r-section { margin-bottom: 18px; }
.resume-paper.tpl-casual .r-section-title { font-size: 0.818em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 10px; }

/* ---- MODERN template ---- */
.resume-paper.tpl-modern .r-head {
    background: #0f172a;
    padding: 28px 32px;
    color: white;
    display: flex;
    align-items: center;
    gap: 20px;
}
.resume-paper.tpl-modern .r-head-info { flex: 1; }
.resume-paper.tpl-modern .r-head h1 { font-size: 2em; font-weight: 800; color: white; margin-bottom: 3px; letter-spacing: -0.02em; }
.resume-paper.tpl-modern .r-head .r-jobtitle { font-size: 0.909em; color: #fbbf24; font-weight: 600; margin-bottom: 10px; }
.resume-paper.tpl-modern .r-head .r-contact { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.818em; color: #94a3b8; }
.resume-paper.tpl-modern .r-photo { width: 72px; height: 72px; border: 3px solid #fbbf24; flex-shrink: 0; }
.resume-paper.tpl-modern .r-body { display: grid; grid-template-columns: 180px 1fr; }
.resume-paper.tpl-modern .r-sidebar { background: #1e293b; padding: 22px 16px; }
.resume-paper.tpl-modern .r-sidebar .r-section-title { font-size: 0.818em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: #fbbf24; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 4px; margin-bottom: 8px; }
.resume-paper.tpl-modern .r-sidebar .r-contact-item { font-size: 0.773em; color: #94a3b8; margin-bottom: 5px; }
.resume-paper.tpl-modern .r-main { padding: 22px 20px; }
.resume-paper.tpl-modern .r-section { margin-bottom: 18px; }
.resume-paper.tpl-modern .r-main .r-section-title { font-size: 0.818em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: #0f172a; border-bottom: 2px solid #fbbf24; padding-bottom: 4px; margin-bottom: 10px; }

/* ---- Personal Details extras grid ---- */
.r-pd-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
}
.r-pd-row {
    display: flex;
    flex-direction: column;
    font-size: 0.773em;
    line-height: 1.4;
    padding: 3px 0;
}
.r-pd-label {
    font-size: 0.682em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    margin-bottom: 1px;
}
.r-pd-value {
    color: #374151;
    font-weight: 500;
}

/* ---- Shared resume entry styles ---- */
.r-entry { margin-bottom: 12px; }
.r-entry-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1px; }
.r-entry-title { font-weight: 700; font-size: 0.955em; color: #1f2937; }
.r-entry-date { font-size: 0.818em; color: #9ca3af; white-space: nowrap; }
.r-entry-sub { font-size: 0.864em; color: #6b7280; margin-bottom: 3px; font-weight: 500; }
.r-entry-desc { font-size: 0.864em; color: #4b5563; line-height: 1.6; }

.r-skill-pill { display: inline-block; padding: 2px 7px; border-radius: 3px; font-size: 0.773em; font-weight: 600; margin: 2px 2px 2px 0; }
.r-skill-pill.light { background: #f1f5f9; color: #475569; }
.r-skill-pill.accent { background: var(--accent-light, #eff6ff); color: var(--accent, #2563eb); }
.r-skill-pill.dark { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.85); }

/* Skill level rows (when levels enabled) */
.r-skill-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.r-skill-name { font-size: 0.773em; font-weight: 600; }
.r-skill-name.light { color: #374151; }
.r-skill-name.dark { color: rgba(255,255,255,0.85); }
.r-skill-name.accent { color: var(--accent,#2563eb); }
.r-skill-dots { display: flex; gap: 3px; }
.r-skill-dot { width: 7px; height: 7px; border-radius: 50%; background: #e5e7eb; }
.r-skill-dot.on { background: var(--accent,#2563eb); }
.r-skill-dot.on.dk { background: rgba(255,255,255,0.75); }

/* Skill level picker in form */
.skill-lvl-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid #f3f4f6; }
.skill-lvl-name { flex: 1; font-size: 0.82rem; font-weight: 600; color: #374151; }
.skill-lvl-dots { display: flex; gap: 5px; }
.skill-lvl-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #d1d5db; background: white; cursor: pointer; transition: all 0.15s; }
.skill-lvl-dot.filled { background: #6366f1; border-color: #6366f1; }
.skill-lvl-dot:hover { border-color: #6366f1; }
.skill-lvl-label { font-size: 0.7rem; color: #9ca3af; width: 72px; text-align: right; }

/* Toggle switch */
.skill-level-toggle { position: relative; display: inline-flex; cursor: pointer; }
.skill-level-toggle input { display: none; }
.slt-track { width: 36px; height: 20px; background: #e5e7eb; border-radius: 10px; transition: background 0.2s; position: relative; }
.slt-thumb { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: white; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.skill-level-toggle input:checked + .slt-track { background: #6366f1; }
.skill-level-toggle input:checked + .slt-track .slt-thumb { transform: translateX(16px); }

.r-lang-item { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 0.864em; }
.r-lang-dots { display: flex; gap: 2px; }
.r-lang-dot { width: 6px; height: 6px; border-radius: 50%; background: #e5e7eb; }
.r-lang-dot.filled { background: var(--accent); }
.r-lang-dot.filled-white { background: rgba(255,255,255,0.7); }
.r-lang-dot.empty-white { background: rgba(255,255,255,0.2); }

/* ============================================
   RICH TEXT EDITOR
   ============================================ */
.rich-toolbar {
    display: flex;
    gap: 4px;
    padding: 4px 6px;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}
.rich-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 0.82rem;
    cursor: pointer;
    color: #374151;
    line-height: 1.5;
    transition: background 0.15s;
}
.rich-btn:hover { background: #e5e7eb; }
.rich-btn:focus { outline: none; background: #dbeafe; border-color: #93c5fd; }

.rich-editor {
    min-height: 80px;
    border-radius: 0 0 8px 8px !important;
    outline: none;
    resize: vertical;
    overflow-y: auto;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
.rich-editor:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
}
.rich-editor ul { margin: 4px 0 4px 18px; padding: 0; }
.rich-editor li { margin-bottom: 2px; }

/* In preview paper */
.r-entry-desc ul, .r-entry-desc ol { margin: 4px 0 4px 16px; padding: 0; }
.r-entry-desc li { margin-bottom: 1px; }
.r-entry-desc p  { margin: 0 0 4px; }
.r-entry-desc strong, .r-entry-desc b { font-weight: 700; }
.r-entry-desc em, .r-entry-desc i { font-style: italic; }

/* ============================================
   CUSTOM SECTIONS
   ============================================ */

.cs-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0 12px;
    align-items: center;
}

.cs-suggest-btn {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 20px;
    background: white;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.4;
}
.cs-suggest-btn:hover { border-color: #6366f1; color: #6366f1; background: #f5f3ff; }

.cs-entry {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

/* ============================================
   COVER LETTER TEMPLATES
   ============================================ */

/* Template selector grid */
.cl-template-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin-bottom: 12px;
}

.cl-tpl-card {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    cursor: pointer;
    user-select: none;
    border-radius: 6px;
    padding: 3px 3px 4px;
    transition: background 0.15s;
}

.cl-tpl-card span {
    font-size: 0.65rem;
    font-weight: 600;
    color: #6b7280;
    transition: color 0.15s;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.cl-tpl-card.active {
    background: #eef2ff;
}
.cl-tpl-card.active span {
    color: #4f46e5;
    font-weight: 700;
}

.cl-tpl-thumb {
    width: 100%;
    height: 68px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    position: relative;
    flex-shrink: 0;
}
.cl-tpl-thumb svg {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0; left: 0;
}

.cl-tpl-card:hover .cl-tpl-thumb { border-color: #a5b4fc; }
.cl-tpl-card.active .cl-tpl-thumb {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.20);
}
/* Checkmark badge on active thumb */
.cl-tpl-card.active .cl-tpl-thumb::after {
    content: '✓';
    position: absolute;
    top: 3px;
    right: 4px;
    font-size: 0.818em;
    font-weight: 700;
    color: white;
    background: #6366f1;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 14px;
    text-align: center;
}

/* Thumbnail elements */
.clt-name        { height: 7px; background: #1e293b; border-radius: 3px; width: 70%; margin-bottom: 4px; }
.clt-bold-name   { height: 9px; background: #1e293b; border-radius: 3px; width: 85%; margin-bottom: 3px; }
.clt-hr          { height: 2px; border-radius: 1px; margin-bottom: 5px; }
.clt-bold-hr     { height: 3px; border-radius: 2px; margin-bottom: 0; }
.clt-line        { height: 4px; background: #e5e7eb; border-radius: 2px; margin-bottom: 3px; width: 100%; }
.clt-line.clt-short { width: 55%; }
.clt-line.clt-long  { width: 85%; }
.clt-header-bar  { height: 28px; width: 100%; }
.clt-sidebar     { width: 28px; height: 100%; min-height: 80px; flex-shrink: 0; }

/* Accent color picker */
.cl-accent-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.cl-accent-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    outline: none;
    flex-shrink: 0;
}

.cl-accent-swatch:hover  { transform: scale(1.15); }
.cl-accent-swatch.active { border-color: white; box-shadow: 0 0 0 2px #6366f1; }

.cl-accent-custom {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    padding: 0;
    background: none;
    overflow: hidden;
    transition: border-color 0.15s;
}
.cl-accent-custom::-webkit-color-swatch-wrapper { padding: 0; }
.cl-accent-custom::-webkit-color-swatch { border: none; border-radius: 50%; }
.cl-accent-custom:hover { border-color: #6366f1; }

/* ============================================
   NEW TEMPLATES: Sharp, Minimal, Timeline, Executive
   ============================================ */

/* ---- SHARP ---- */
.resume-paper.tpl-sharp { display: flex; flex-direction: column; }
.r-sharp-head { background: var(--accent,#6366f1); padding: 22px 24px 18px; display: flex; justify-content: space-between; align-items: flex-end; }
.r-sharp-name-block { flex: 1; }
.r-sharp-contact { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.r-sharp-contact span { font-size: 0.727em; color: rgba(255,255,255,0.8); }
.tt-sharp-head { height: 22px; background: var(--accent,#6366f1); border-radius: 2px 2px 0 0; }
.resume-paper.tpl-sharp .r-section { margin-bottom: 16px; }
.resume-paper.tpl-sharp .r-section-title { font-size: 0.773em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent,#6366f1); border-left: 3px solid var(--accent,#6366f1); padding-left: 6px; margin-bottom: 8px; }
.resume-paper.tpl-sharp .r-entry { margin-bottom: 10px; }
.resume-paper.tpl-sharp .r-entry-title { font-size: 0.909em; font-weight: 700; color: #111; }
.resume-paper.tpl-sharp .r-entry-date { font-size: 0.773em; color: #9ca3af; }
.resume-paper.tpl-sharp .r-entry-sub { font-size: 0.818em; color: #6b7280; font-weight: 500; }
.resume-paper.tpl-sharp .r-entry-desc { font-size: 0.818em; color: #4b5563; margin-top: 3px; line-height: 1.5; }

/* ---- MINIMAL ---- */
.resume-paper.tpl-minimal { display: flex; flex-direction: column; }
.r-minimal-sec .r-section-title { font-size: 0.818em; font-weight: 700; color: #111; border-bottom: 1px solid #111; padding-bottom: 3px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.08em; }
.resume-paper.tpl-minimal .r-section { margin-bottom: 16px; }
.resume-paper.tpl-minimal .r-entry { margin-bottom: 10px; }
.resume-paper.tpl-minimal .r-entry-title { font-size: 0.909em; font-weight: 700; color: #111; }
.resume-paper.tpl-minimal .r-entry-date { font-size: 0.773em; color: #9ca3af; }
.resume-paper.tpl-minimal .r-entry-sub { font-size: 0.818em; color: #6b7280; }
.resume-paper.tpl-minimal .r-entry-desc { font-size: 0.818em; color: #374151; margin-top: 3px; line-height: 1.6; }
.resume-paper.tpl-minimal .r-section-title { font-size: 0.818em; font-weight: 700; color: #111; border-bottom: 1px solid #d1d5db; padding-bottom: 3px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---- TIMELINE ---- */
.resume-paper.tpl-timeline { display: flex; flex-direction: column; }
.resume-paper.tpl-timeline .r-head { padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; }
.resume-paper.tpl-timeline .r-section { margin-bottom: 16px; }
.resume-paper.tpl-timeline .r-section-title { font-size: 0.818em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); padding-bottom: 4px; border-bottom: 2px solid var(--accent); margin-bottom: 10px; }
.r-tl-list { position: relative; padding-left: 16px; border-left: 2px solid #e5e7eb; }
.r-tl-item { position: relative; margin-bottom: 12px; padding-left: 12px; }
.r-tl-dot { position: absolute; left: -20px; top: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent,#6366f1); border: 2px solid white; box-shadow: 0 0 0 1px var(--accent,#6366f1); }
.r-tl-body .r-entry-title { font-size: 0.909em; font-weight: 700; color: #111; }
.r-tl-body .r-entry-date { font-size: 0.773em; color: #9ca3af; }
.r-tl-body .r-entry-sub { font-size: 0.818em; color: #6b7280; font-weight: 500; margin-bottom: 2px; }
.r-tl-body .r-entry-desc { font-size: 0.818em; color: #4b5563; line-height: 1.5; }

/* ---- EXECUTIVE ---- */
.resume-paper.tpl-executive { display: flex; flex-direction: column; }
.r-exec-sec .r-section-title { font-size: 0.818em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.15em; color: var(--accent); border-top: 1.5px solid var(--accent); padding-top: 6px; margin-bottom: 10px; }
.resume-paper.tpl-executive .r-section { margin-bottom: 16px; }
.resume-paper.tpl-executive .r-entry { margin-bottom: 10px; }
.resume-paper.tpl-executive .r-entry-title { font-size: 0.909em; font-weight: 700; color: #111; }
.resume-paper.tpl-executive .r-entry-date { font-size: 0.773em; color: #9ca3af; }
.resume-paper.tpl-executive .r-entry-sub { font-size: 0.818em; color: #6b7280; font-style: italic; }
.resume-paper.tpl-executive .r-entry-desc { font-size: 0.818em; color: #374151; margin-top: 3px; line-height: 1.6; }

/* ---- HARVARD ---- */
.resume-paper.tpl-harvard { display: flex; flex-direction: column; }
.r-hv-header { text-align: center; padding: 20px 36px 12px; border-bottom: 1.5px solid #111; margin-bottom: 0; }
.r-hv-name { font-size: 1.818em; font-weight: 700; color: #111; margin: 0 0 5px; letter-spacing: 0; line-height: 1.1; }
.r-hv-contact { font-size: 0.773em; color: #555; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.r-hv-body { padding: 10px 36px 24px; }
.r-hv-sec { margin-bottom: 12px; }
.r-hv-sec-title { font-size: 0.909em; font-weight: 700; color: #111; border-bottom: 1.5px solid #111; padding-bottom: 2px; margin-bottom: 7px; }
.r-hv-entry { margin-bottom: 8px; }
.resume-paper.tpl-harvard .r-entry-header { display: flex; justify-content: space-between; align-items: baseline; }
.resume-paper.tpl-harvard .r-entry-title { font-size: 0.909em; font-weight: 700; color: #111; }
.resume-paper.tpl-harvard .r-entry-date { font-size: 0.773em; color: #555; white-space: nowrap; }
.resume-paper.tpl-harvard .r-entry-sub { font-size: 0.818em; color: #444; font-style: italic; margin-bottom: 2px; }
.resume-paper.tpl-harvard .r-entry-desc { font-size: 0.818em; color: #374151; margin-top: 2px; line-height: 1.55; }
.r-hv-skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px 0; }
.r-hv-skill-item { font-size: 0.818em; color: #374151; }
.resume-paper.tpl-harvard .r-lang-item { margin-bottom: 3px; font-size: 0.818em; }

/* ---- MCKINSEY ---- */
.resume-paper.tpl-mckinsey { display: flex; flex-direction: column; }
.r-mk-header { text-align: center; padding: 22px 36px 14px; }
.r-mk-name { font-size: 1.818em; font-weight: 700; color: #111; margin: 0 0 4px; }
.r-mk-jobtitle { font-size: 0.909em; color: #555; margin-bottom: 5px; }
.r-mk-contact { font-size: 0.773em; color: #666; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.r-mk-body { padding: 2px 32px 24px; }
.r-mk-sec { margin-bottom: 13px; }
.r-mk-sec-title { font-size: 0.864em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: #111; border-bottom: 2px solid #111; padding-bottom: 3px; margin-bottom: 8px; }
.resume-paper.tpl-mckinsey .r-entry { margin-bottom: 9px; }
.resume-paper.tpl-mckinsey .r-entry-header { display: flex; justify-content: space-between; align-items: baseline; }
.resume-paper.tpl-mckinsey .r-entry-title { font-size: 0.909em; font-weight: 700; color: #111; }
.resume-paper.tpl-mckinsey .r-entry-date { font-size: 0.773em; color: #666; white-space: nowrap; }
.resume-paper.tpl-mckinsey .r-entry-sub { font-size: 0.818em; color: #444; font-style: italic; margin-bottom: 2px; }
.resume-paper.tpl-mckinsey .r-entry-desc { font-size: 0.818em; color: #374151; margin-top: 2px; line-height: 1.55; }
.resume-paper.tpl-mckinsey .r-skill-pill { background: #f3f4f6; color: #374151; }

/* ---- CORPORATE ---- */
.resume-paper.tpl-corporate { display: flex; flex-direction: column; }
.r-corp-header { text-align: center; padding: 20px 36px 12px; }
.r-corp-name { font-size: 2em; font-weight: 800; color: #111; margin: 0 0 3px; letter-spacing: 0.01em; }
.r-corp-jobtitle { font-size: 0.909em; color: #555; font-style: italic; margin-bottom: 8px; }
.r-corp-divider { height: 1px; background: #111; margin-bottom: 7px; }
.r-corp-contact { font-size: 0.773em; color: #555; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.r-corp-body { padding: 6px 28px 24px; }
.r-corp-sec { margin-bottom: 12px; }
.r-corp-sec-title { font-size: 0.818em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: #111; text-align: center; padding: 3px 0; border-top: 1.5px solid #111; border-bottom: 1.5px solid #111; margin-bottom: 9px; }
.resume-paper.tpl-corporate .r-entry { margin-bottom: 9px; }
.resume-paper.tpl-corporate .r-entry-header { display: flex; justify-content: space-between; align-items: baseline; }
.resume-paper.tpl-corporate .r-entry-title { font-size: 0.909em; font-weight: 700; color: #111; }
.resume-paper.tpl-corporate .r-entry-date { font-size: 0.773em; color: #666; white-space: nowrap; }
.resume-paper.tpl-corporate .r-entry-sub { font-size: 0.818em; color: #555; font-style: italic; margin-bottom: 2px; }
.resume-paper.tpl-corporate .r-entry-desc { font-size: 0.818em; color: #374151; margin-top: 2px; line-height: 1.55; }
.resume-paper.tpl-corporate .r-lang-item { margin-bottom: 3px; }

/* ---- ATLANTIC ---- */
.resume-paper.tpl-atlantic { display: flex; flex-direction: row; overflow: hidden; }
.r-atl-sidebar { width: 38%; background: #1b2d3e; color: #fff; padding: 20px 14px; display: flex; flex-direction: column; flex-shrink: 0; box-sizing: border-box; }
.r-atl-name { font-size: 1.273em; font-weight: 800; color: #fff; margin: 0 0 3px; line-height: 1.2; }
.r-atl-jobtitle { font-size: 0.773em; color: #8bb8d4; margin-bottom: 10px; line-height: 1.3; }
.r-atl-contact { margin-bottom: 12px; }
.r-atl-contact-item { font-size: 0.727em; color: rgba(255,255,255,0.72); margin-bottom: 3px; word-break: break-all; line-height: 1.3; }
.r-atl-sec { margin-bottom: 10px; }
.r-atl-sec-title { font-size: 0.682em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #fff; background: rgba(255,255,255,0.1); padding: 3px 6px; margin: 0 -14px 6px; display: block; }
.r-atl-sec-body { font-size: 0.727em; color: rgba(255,255,255,0.78); line-height: 1.5; }
.r-atl-skill-item { font-size: 0.727em; color: rgba(255,255,255,0.82); margin-bottom: 2px; }
.r-atl-sidebar .r-lang-item { font-size: 0.727em; color: rgba(255,255,255,0.82); margin-bottom: 3px; }
.r-atl-sidebar .r-lang-dot.filled-white { background: rgba(255,255,255,0.85); }
.r-atl-sidebar .r-lang-dot.empty-white { background: rgba(255,255,255,0.22); }
.r-atl-main { flex: 1; padding: 18px 18px 20px 16px; background: #fff; overflow: hidden; }
.r-atl-main-sec { margin-bottom: 13px; }
.r-atl-main-sec-title { font-size: 0.773em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; background: #eef2f7; padding: 3px 8px; margin: 0 -8px 8px; color: #1b2d3e; border-left: 3px solid var(--accent, #2563eb); display: block; }
.r-atl-entry { margin-bottom: 9px; }
.r-atl-entry-title { font-size: 0.864em; font-weight: 700; color: #111; }
.r-atl-entry-meta { font-size: 0.773em; color: #666; margin-bottom: 2px; }
.r-atl-entry-date { color: #888; }
.r-atl-entry-desc { font-size: 0.773em; color: #374151; margin-top: 2px; line-height: 1.5; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .builder-workspace { flex-direction: column; }
    .builder-preview-panel { display: none; }
    .builder-divider { display: none; }
}
