/* =====================================================================
   cover.css: the cover letter page and its six letter designs.
   The page shell (top bar, split view, form cards) reuses builder.css.
   Letter designs read these variables, set by cover.js:
     --c-accent  --c-font  --c-size  --c-scale (auto fit to one page)
   ===================================================================== */

/* ---------- The A4 letter ---------- */
.cl-page { height: 1123px; min-height: 1123px; }
.cl-doc {
  --c-pad: 64px;
  height: 100%;
  font-family: var(--c-font, "Inter", sans-serif);
  font-size: calc(var(--c-size, 11pt) * var(--c-scale, 1));
  line-height: 1.55;
  color: #222834;
}
.cl-name { margin: 0; font-size: 2.05em; font-weight: 800; line-height: 1.1; color: #141925; letter-spacing: -.01em; }
.cl-role { margin-top: 3px; color: var(--c-accent); font-weight: 600; font-size: 1.05em; }
.cl-contact { display: flex; flex-wrap: wrap; gap: 4px 14px; color: #4a5263; font-size: .9em; }
.cl-contact i { font-style: normal; color: #a3a9b6; }
.cl-main { padding: 0 var(--c-pad) var(--c-pad); }
.cl-date { margin-bottom: 1.4em; color: #3d4452; }
.cl-to { margin-bottom: 1.4em; color: #2a303c; }
.cl-to div:first-child { font-weight: 700; }
.cl-subject { font-weight: 700; margin-bottom: 1.2em; color: #141925; }
.cl-greet { margin: 0 0 .9em; }
.cl-text p { margin: 0 0 .95em; text-align: left; }
.cl-sign { margin-top: 1.5em; }
.cl-signame { margin-top: 2.6em; font-weight: 700; color: #141925; }
.cl-placeholder { color: #8a92a3; font-style: italic; }

/* 1) MODERN: name and accent rule on the left */
.cl-modern .cl-head { padding: var(--c-pad) var(--c-pad) 22px; margin-bottom: 30px; border-bottom: 2px solid color-mix(in srgb, var(--c-accent) 35%, #fff); display: flex; flex-direction: column; gap: 10px; }
.cl-modern .cl-subject { color: var(--c-accent); }

/* 2) CLASSIC: centred letterhead, thin rules, serif friendly */
.cl-classic .cl-head { text-align: center; padding: var(--c-pad) var(--c-pad) 18px; margin: 0 var(--c-pad) 30px; border-bottom: 1px solid #cfd3dc; display: flex; flex-direction: column; gap: 8px; }
.cl-classic .cl-head { padding-left: 0; padding-right: 0; }
.cl-classic .cl-contact { justify-content: center; }
.cl-classic .cl-role { color: #3c4250; }
.cl-classic .cl-name { letter-spacing: .03em; }

/* 3) EXECUTIVE: full width accent band */
.cl-executive .cl-head { background: var(--c-accent); color: #fff; padding: 46px var(--c-pad) 34px; margin-bottom: 40px; display: flex; flex-direction: column; gap: 10px; }
.cl-executive .cl-name { color: #fff; }
.cl-executive .cl-role { color: rgba(255,255,255,.88); }
.cl-executive .cl-contact { color: rgba(255,255,255,.92); }

/* 4) MINIMAL: small uppercase name, contacts to the right */
.cl-minimal .cl-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: var(--c-pad) var(--c-pad) 0; margin-bottom: 52px; }
.cl-minimal .cl-name { font-size: 1.7em; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.cl-minimal .cl-role { color: #86868b; font-weight: 500; }
.cl-minimal .cl-contact { flex-direction: column; align-items: flex-end; text-align: right; gap: 1px; max-width: 46%; }

/* 5) PROFESSIONAL: serif name, double rule (law, finance, government) */
.cl-professional .cl-head { padding: var(--c-pad) var(--c-pad) 0; margin-bottom: 34px; display: flex; flex-direction: column; gap: 8px; }
.cl-professional .cl-head::after { content: ""; display: block; margin-top: 12px; border-top: 3px double var(--c-accent); }
.cl-professional .cl-name { font-family: Georgia, "Times New Roman", serif; font-weight: 700; letter-spacing: .01em; }
.cl-professional .cl-role { color: #4a5263; font-style: italic; font-weight: 500; }
.cl-professional .cl-subject { text-transform: uppercase; letter-spacing: .06em; font-size: .92em; }

/* 6) CREATIVE: accent sidebar with name and contacts */
.cl-creative { display: grid; grid-template-columns: 220px 1fr; }
.cl-creative .cl-side { background: var(--c-accent); color: #fff; padding: var(--c-pad) 28px; }
.cl-creative .cl-side .cl-name { color: #fff; font-size: 1.75em; overflow-wrap: anywhere; }
.cl-creative .cl-side .cl-role { color: rgba(255,255,255,.88); margin-bottom: 28px; }
.cl-creative .cl-side .cl-contact { flex-direction: column; color: rgba(255,255,255,.92); gap: 8px; font-size: .86em; overflow-wrap: anywhere; }
.cl-creative .cl-main { padding: var(--c-pad) 54px var(--c-pad) 44px; }
.cl-creative .cl-subject { color: var(--c-accent); }

/* ---------- Page: form extras ---------- */
.cl-sec summary { list-style: none; cursor: pointer; }
.cl-sec summary::-webkit-details-marker { display: none; }
.cl-sec .rz-sec-caret svg { transition: transform .2s ease; }
.cl-sec:not([open]) .rz-sec-caret svg { transform: rotate(-90deg); }
.cl-sec .rz-sec-head { padding-left: 12px; }
.cl-hint { font-size: .8rem; color: var(--rz-muted); margin: -2px 0 10px; }
.cl-jd { min-height: 150px; }
.cl-bodybox { min-height: 330px; line-height: 1.55; }

.cl-tones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.cl-tone { border: 1px solid var(--color-steel); background: #fff; border-radius: var(--rz-radius-pill); padding: 7px 6px; font-family: var(--rz-font-body); font-weight: 400; font-size: .82rem; color: var(--rz-ink); cursor: pointer; }
.cl-tone:hover { border-color: var(--rz-ink); }
.cl-tone.is-active { border-color: var(--rz-ink); color: #fff; background: var(--rz-ink); }

.cl-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cl-actions .btn { padding: 10px 16px; font-size: .9rem; }
.cl-actions .btn-rz-primary { flex: 1; }

.cl-result { margin-top: 12px; padding: 12px 14px; border-radius: var(--rz-radius-sm); background: #f0f8f2; border: 0; color: var(--color-ok); font-size: .84rem; }
.cl-result.is-warn { background: #fff6e5; color: var(--color-launch-orange); }
.cl-result strong { display: block; margin-bottom: 4px; }
.cl-result .cl-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.cl-result .cl-chips span { background: #fff; border: 0; border-radius: var(--rz-radius-pill); padding: 1px 8px; font-weight: 600; }

.cl-meter { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--rz-muted); margin-top: -2px; }
.cl-meter b { font-weight: 600; }
.cl-meter .ok { color: var(--color-ok); }
.cl-meter .bad { color: #e30000; }

.cl-designs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cl-design { border: 1px solid var(--rz-line); border-radius: var(--rz-radius-sm); background: #fff; padding: 8px; cursor: pointer; font-family: var(--rz-font-body); font-weight: 400; font-size: .78rem; color: var(--rz-ink); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cl-design:hover { border-color: var(--color-steel); }
.cl-design.is-active { border-color: var(--rz-primary); box-shadow: 0 0 0 1px var(--rz-primary); }
.cl-design i { display: block; width: 42px; height: 54px; border-radius: 3px; background: #fff; box-shadow: inset 0 0 0 1px #d6d6d6; position: relative; overflow: hidden; }
.cl-design i::before, .cl-design i::after { content: ""; position: absolute; }
.cl-design[data-design="modern"] i::before { left: 6px; top: 7px; width: 22px; height: 4px; background: var(--sw); }
.cl-design[data-design="modern"] i::after { left: 6px; right: 6px; top: 15px; height: 1.5px; background: var(--sw); opacity: .5; }
.cl-design[data-design="classic"] i::before { left: 12px; right: 12px; top: 7px; height: 4px; background: #333; }
.cl-design[data-design="classic"] i::after { left: 6px; right: 6px; top: 15px; height: 1px; background: #bbb; }
.cl-design[data-design="executive"] i::before { left: 0; right: 0; top: 0; height: 14px; background: var(--sw); }
.cl-design[data-design="minimal"] i::before { left: 6px; top: 8px; width: 16px; height: 3px; background: #333; }
.cl-design[data-design="minimal"] i::after { right: 6px; top: 8px; width: 10px; height: 6px; background: #ccc; }
.cl-design[data-design="professional"] i::before { left: 6px; top: 7px; width: 24px; height: 4px; background: #333; }
.cl-design[data-design="professional"] i::after { left: 6px; right: 6px; top: 15px; height: 3px; border-top: 1px solid var(--sw); border-bottom: 1px solid var(--sw); }
.cl-design[data-design="creative"] i::before { left: 0; top: 0; bottom: 0; width: 13px; background: var(--sw); }

.cl-overflow { display: none; margin: 0 auto 14px; max-width: 794px; padding: 10px 16px; border-radius: var(--rz-radius-sm); background: #fff5f5; border: 0; color: #c00; font-size: .86rem; }
.cl-overflow.is-on { display: block; }

/* ---------- Print: exactly one A4 page ---------- */
@media print {
  .cl-overflow, .rz-toast { display: none !important; }
  .cl-page { height: 297mm !important; min-height: 297mm !important; max-height: 297mm !important; overflow: hidden !important; }
}
.cl-design { position: relative; } .cl-design .rz-crown { position: absolute; top: 5px; right: 5px; width: 12px; height: 12px; } .cl-design .cz-free { position: absolute; top: 4px; right: 4px; font-size: .6rem; font-weight: 700; color: var(--color-ok); background: none; border-radius: 0; padding: 0; }
