/* Cover Letter Builder Styles */
.clw { margin-top: 10px; }
.clw-body { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.clw-left { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; box-shadow: var(--shadow-sm); }
.clw-bar-samples { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.cl-sec-title { font-size: 14px; font-weight: 700; color: var(--ink); margin: 16px 0 10px; padding-bottom: 4px; border-bottom: 2px solid var(--brand-soft); }
.cl-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cl-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 640px) {
  .cl-grid-2, .cl-grid-3 { grid-template-columns: 1fr; }
}

.cl-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; background: #fff; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; }
.cl-tpl-picker, .cl-accent-picker { display: flex; align-items: center; gap: 8px; }
.cl-colors { display: flex; gap: 6px; }
.cl-c-btn { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; outline: 1px solid #d1d5db; cursor: pointer; transition: transform .15s; }
.cl-c-btn.is-active { outline: 2px solid var(--ink); transform: scale(1.15); }

/* A4 Sheet Preview Stage */
.cl-stage { position: relative; width: 100%; aspect-ratio: 210 / 297; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); background: #fff; }
.cl-sheet { width: 794px; min-height: 1123px; background: #fff; color: #1e293b; font-family: Inter, Arial, sans-serif; box-sizing: border-box; padding: 60px 64px; position: absolute; left: 0; top: 0; transform-origin: 0 0; line-height: 1.6; font-size: 14px; }
.cl-sheet h1, .cl-sheet h2, .cl-sheet p { margin: 0; }

/* Letter Layout Elements */
.cl-head { margin-bottom: 24px; }
.cl-name { font-size: 26px; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; }
.cl-title { font-size: 15px; font-weight: 600; margin-top: 2px; }
.cl-contacts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: #64748b; margin-top: 8px; }
.cl-divider { height: 2px; margin: 16px 0 20px; background: #e2e8f0; }

.cl-meta { margin-bottom: 24px; font-size: 13px; color: #475569; display: grid; gap: 2px; }
.cl-date { margin-bottom: 12px; color: #64748b; font-size: 13px; }
.cl-rec-name { font-weight: 700; color: #1e293b; }
.cl-rec-comp { font-weight: 600; }

.cl-body { font-size: 13.5px; line-height: 1.65; color: #334155; }
.cl-body p { margin-bottom: 16px; white-space: pre-line; }
.cl-salutation { font-weight: 600; margin-bottom: 14px; color: #0f172a; }
.cl-sign { margin-top: 28px; }
.cl-signoff { color: #475569; font-size: 13.5px; }
.cl-sign-name { font-weight: 700; font-size: 15px; margin-top: 24px; color: #0f172a; }

/* Templates */
/* 1. Modern */
.cl-sheet[data-t="modern"] .cl-name { color: var(--cl-accent); }
.cl-sheet[data-t="modern"] .cl-divider { background: var(--cl-accent); height: 3px; }

/* 2. Classic */
.cl-sheet[data-t="classic"] .cl-head { text-align: center; border-bottom: 1px solid #cbd5e1; padding-bottom: 16px; margin-bottom: 24px; }
.cl-sheet[data-t="classic"] .cl-contacts { justify-content: center; }
.cl-sheet[data-t="classic"] .cl-divider { display: none; }

/* 3. Minimal */
.cl-sheet[data-t="minimal"] { padding: 70px 72px; }
.cl-sheet[data-t="minimal"] .cl-name { font-weight: 600; font-size: 24px; letter-spacing: 0; }
.cl-sheet[data-t="minimal"] .cl-title { color: #64748b; font-weight: 400; text-transform: uppercase; font-size: 12px; letter-spacing: .08em; }
.cl-sheet[data-t="minimal"] .cl-divider { display: none; }
.cl-sheet[data-t="minimal"] .cl-meta { margin-top: 10px; }

/* 4. Corporate */
.cl-sheet[data-t="corporate"] { border-left: 12px solid var(--cl-accent); padding-left: 52px; }
.cl-sheet[data-t="corporate"] .cl-name { color: var(--cl-accent); }

/* 5. Elegant */
.cl-sheet[data-t="elegant"] { font-family: Georgia, "Times New Roman", serif; font-size: 14.5px; }
.cl-sheet[data-t="elegant"] .cl-head { text-align: center; border-bottom: 2px double #cbd5e1; padding-bottom: 14px; }
.cl-sheet[data-t="elegant"] .cl-name { font-size: 28px; font-weight: 400; letter-spacing: .04em; text-transform: uppercase; }
.cl-sheet[data-t="elegant"] .cl-contacts { justify-content: center; font-style: italic; }
.cl-sheet[data-t="elegant"] .cl-divider { display: none; }

@media (max-width: 860px) {
  .clw-body { grid-template-columns: 1fr; }
}
