/* ==========================================================================
   CRM — Editor șabloane „Emailuri automate (SMTP propriu)"
   Fișier: public/css/crm-email-templates.css  (pereche cu public/js/crmEmailTemplates.js)
   Prefix unic: .cet-  — nu se suprapune cu crm.css. Mobile-first; țintele tactile ≥ 44px.
   Paleta urmează crm.css: fundal alb, text #1e293b, accent #0ea5e9, AI violet (#8b5cf6 → #6d28d9).
   ========================================================================== */

.cet-root {
    --cet-text: #1e293b;
    --cet-muted: #64748b;
    --cet-border: #e2e8f0;
    --cet-bg-soft: #f8fafc;
    --cet-primary: #0ea5e9;
    --cet-danger: #ef4444;
    --cet-ai-a: #8b5cf6;
    --cet-ai-b: #6d28d9;
    --cet-radius: 12px;
    color: var(--cet-text);
}

/* Variabilele trebuie să existe și în overlay (care e atașat pe <body>, nu în .cet-root) */
.cet-overlay,
.cet-dialog-overlay {
    --cet-text: #1e293b;
    --cet-muted: #64748b;
    --cet-border: #e2e8f0;
    --cet-bg-soft: #f8fafc;
    --cet-primary: #0ea5e9;
    --cet-danger: #ef4444;
    --cet-ai-a: #8b5cf6;
    --cet-ai-b: #6d28d9;
    --cet-radius: 12px;
    color: var(--cet-text);
}

/* Atributul `hidden` trebuie să bată orice `display:flex/grid` de mai jos (ex. .cet-regen, .cet-subjects) */
.cet-root [hidden],
.cet-overlay [hidden],
.cet-dialog-overlay [hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   Butoane (completează .btn din crm.css; asigură ținta tactilă)
   -------------------------------------------------------------------------- */
.cet-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    border: none;
    touch-action: manipulation;
    white-space: nowrap;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, opacity .15s ease;
}
.cet-btn:disabled { opacity: .6; cursor: default; transform: none !important; box-shadow: none !important; }
.cet-btn-sm { min-height: 40px; padding: 8px 12px; font-size: 13px; }
.cet-btn-danger { background: #fee2e2; color: #b91c1c; }
.cet-btn-danger:hover { background: #fecaca; }

.cet-btn-ai {
    background: linear-gradient(135deg, var(--cet-ai-a), var(--cet-ai-b));
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(109, 40, 217, .25);
}
.cet-btn-ai:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(109, 40, 217, .35); }
.cet-btn-ai.is-busy { background: linear-gradient(135deg, #a78bfa, #7c3aed); }

.cet-spinner {
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,.45);
    border-top-color: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: cet-spin .7s linear infinite;
}
.btn-secondary .cet-spinner { border-color: rgba(255,255,255,.4); border-top-color: #fff; }
@keyframes cet-spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   Toolbar + listă (Pasul 3 în secțiunea CRM Email)
   -------------------------------------------------------------------------- */
.cet-toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
}
.cet-toolbar-text { display: flex; flex-direction: column; gap: 4px; }
.cet-toolbar-text strong { font-size: 15px; color: var(--cet-text); }
.cet-toolbar-text span { font-size: 13px; color: var(--cet-muted); line-height: 1.45; }
.cet-btn-new { width: 100%; }

.cet-loading, .cet-blocks-empty {
    padding: 18px;
    border: 1px dashed var(--cet-border);
    border-radius: var(--cet-radius);
    color: var(--cet-muted);
    font-size: 13px;
    text-align: center;
    background: var(--cet-bg-soft);
}

.cet-error {
    display: flex; flex-direction: column; gap: 8px;
    padding: 16px; border-radius: var(--cet-radius);
    background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; font-size: 13px;
}

.cet-cards { display: grid; grid-template-columns: 1fr; gap: 12px; }

.cet-card {
    display: grid;
    grid-template-columns: 44px 1fr;
    grid-template-areas: "swatch main" "actions actions";
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--cet-border);
    border-radius: var(--cet-radius);
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    transition: box-shadow .15s ease, transform .15s ease;
}
.cet-card:hover { box-shadow: 0 6px 18px rgba(15, 23, 42, .08); }
.cet-card--inactive { opacity: .72; }
.cet-card-swatch {
    grid-area: swatch;
    width: 44px; height: 56px;
    border-radius: 8px; border: 2px solid;
    display: flex; align-items: flex-end; justify-content: center; padding: 6px;
}
.cet-card-swatch span { display: block; width: 70%; height: 8px; border-radius: 4px; }
.cet-card-main { grid-area: main; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cet-card-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cet-card-title h4 { margin: 0; font-size: 15px; font-weight: 700; color: var(--cet-text); word-break: break-word; }
.cet-card-subject { font-size: 13px; color: #334155; word-break: break-word; }
.cet-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--cet-muted); }
.cet-card-actions { grid-area: actions; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cet-card-actions .cet-btn { width: 100%; }

.cet-badge {
    display: inline-block; padding: 2px 8px; border-radius: 999px;
    font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.cet-badge--on { background: #dcfce7; color: #166534; }
.cet-badge--off { background: #f1f5f9; color: #475569; }

.cet-list-help { margin: 14px 0 0; font-size: 12.5px; color: var(--cet-muted); line-height: 1.5; }
.cet-list-help code, .cet-group-title code, .cet-hint code, .cet-note code {
    background: #f1f5f9; color: #0f172a; padding: 1px 5px; border-radius: 4px; font-size: 12px;
}

/* stare goală + exemple */
.cet-empty { display: flex; flex-direction: column; gap: 14px; }
.cet-empty-hero {
    text-align: center; padding: 26px 18px;
    border: 1px dashed #bae6fd; border-radius: var(--cet-radius);
    background: linear-gradient(180deg, #f0f9ff, #ffffff);
}
.cet-empty-icon { font-size: 40px; line-height: 1; margin-bottom: 8px; }
.cet-empty-hero h4 { margin: 0 0 6px; font-size: 18px; color: var(--cet-text); }
.cet-empty-hero p { margin: 0 auto 14px; max-width: 560px; font-size: 13.5px; color: var(--cet-muted); line-height: 1.5; }
.cet-examples { display: grid; grid-template-columns: 1fr; gap: 10px; }
.cet-example {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    text-align: left; padding: 14px; min-height: 44px;
    border: 1px solid var(--cet-border); border-radius: var(--cet-radius); background: #fff;
    cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.cet-example:hover { border-color: var(--cet-primary); box-shadow: 0 6px 18px rgba(14, 165, 233, .15); transform: translateY(-1px); }
.cet-example-icon { font-size: 24px; }
.cet-example-title { font-weight: 700; font-size: 14.5px; color: var(--cet-text); }
.cet-example-hint { font-size: 12.5px; color: var(--cet-muted); line-height: 1.4; }
.cet-example-cta { margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--cet-primary); }

/* --------------------------------------------------------------------------
   Editor (overlay full-screen pe mobil, fereastră mare pe desktop)
   -------------------------------------------------------------------------- */
body.cet-lock-scroll { overflow: hidden; }

.cet-overlay {
    position: fixed; inset: 0;
    z-index: 10000;                /* peste modalele CRM (9999), sub toast-uri (10001) */
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(3px);
    display: flex; align-items: stretch; justify-content: center;
}
.cet-editor {
    width: 100%; height: 100%;
    background: #fff;
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: cet-slide-up .22s ease;
}
@keyframes cet-slide-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.cet-editor-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px 14px;
    padding-top: calc(12px + env(safe-area-inset-top));
    border-bottom: 1px solid var(--cet-border);
    background: var(--cet-bg-soft);
    flex: 0 0 auto;
}
.cet-editor-head-text { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cet-editor-head h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--cet-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cet-dirty { font-size: 12px; font-weight: 700; color: #b45309; background: #fef3c7; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.cet-editor-head-actions { display: flex; align-items: center; gap: 8px; }
.cet-editor-head-actions [data-cet="send-test"],
.cet-editor-head-actions [data-cet="save"] { display: none; }   /* pe mobil, acțiunile sunt în footer */
.cet-close {
    width: 44px; height: 44px; border-radius: 10px;
    background: #fff; color: var(--cet-muted); font-size: 28px; line-height: 1; cursor: pointer;
    border: 1px solid var(--cet-border);
}
.cet-close:hover { color: var(--cet-text); background: #f1f5f9; }

.cet-editor-body {
    flex: 1 1 auto; min-height: 0;
    overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex; flex-direction: column;
}
.cet-pane { padding: 14px; }
.cet-pane-edit { display: flex; flex-direction: column; gap: 14px; }
.cet-pane-preview { background: var(--cet-bg-soft); border-top: 1px solid var(--cet-border); }

.cet-editor-foot {
    flex: 0 0 auto;
    display: grid; grid-template-columns: 1fr; gap: 8px;
    padding: 10px 14px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--cet-border);
    background: #fff;
}
.cet-editor-foot .cet-btn { width: 100%; }

/* grupuri de câmpuri */
.cet-group {
    border: 1px solid var(--cet-border); border-radius: var(--cet-radius);
    padding: 14px; background: #fff;
    display: flex; flex-direction: column; gap: 12px;
}
.cet-group-title { display: flex; flex-direction: column; gap: 3px; }
.cet-group-title strong { font-size: 15px; color: var(--cet-text); }
.cet-group-title span { font-size: 12.5px; color: var(--cet-muted); line-height: 1.5; }
.cet-subgroup { display: flex; flex-direction: column; gap: 8px; }
.cet-sublabel { font-size: 13px; font-weight: 600; color: #334155; }
.cet-cols-2 { display: grid; grid-template-columns: 1fr; gap: 10px; }

.cet-field { display: flex; flex-direction: column; gap: 5px; }
.cet-field > span { font-size: 13px; font-weight: 600; color: #334155; }
.cet-field > span em { font-weight: 400; color: var(--cet-muted); font-style: normal; }
.cet-field input, .cet-field textarea, .cet-input, .cet-select,
.cet-pane-edit textarea[data-cet="body"], .cet-block textarea, .cet-block .cet-input {
    width: 100%; box-sizing: border-box;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1; border-radius: 10px;
    font-size: 16px;                /* ≥16px: iOS nu face zoom la focus */
    color: var(--cet-text); background: #fff;
    font-family: inherit; line-height: 1.45;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.cet-field input:focus, .cet-field textarea:focus, .cet-input:focus, .cet-select:focus,
.cet-pane-edit textarea[data-cet="body"]:focus, .cet-block textarea:focus, .cet-block .cet-input:focus {
    outline: none; border-color: var(--cet-primary); box-shadow: 0 0 0 3px rgba(14, 165, 233, .18);
}
.cet-pane-edit textarea[data-cet="body"] { min-height: 220px; resize: vertical; font-size: 16px; }
.cet-field textarea { resize: vertical; }
.cet-check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: #334155; min-height: 44px; cursor: pointer; }
.cet-check input { width: 20px; height: 20px; margin-top: 1px; flex: 0 0 auto; accent-color: var(--cet-primary); }

.cet-hint { font-size: 12.5px; color: var(--cet-muted); line-height: 1.45; }
.cet-inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cet-inline-actions .cet-btn { flex: 1 1 auto; }

/* chips variabile */
.cet-vars { display: flex; flex-direction: column; gap: 6px; }
.cet-vars-label { font-size: 12.5px; font-weight: 600; color: #334155; }
.cet-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cet-chip {
    min-height: 36px; padding: 6px 12px;
    border-radius: 999px; border: 1px solid #c7d2fe;
    background: #eef2ff; color: #3730a3;
    font-size: 12.5px; font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    cursor: pointer; touch-action: manipulation;
    transition: background .15s ease, transform .15s ease;
}
.cet-chip:hover { background: #e0e7ff; transform: translateY(-1px); }
.cet-chip:active { transform: scale(.97); }

/* rânduri AI */
.cet-ai-row { display: flex; flex-direction: column; gap: 8px; }
.cet-ai-row-main { display: flex; flex-direction: column; gap: 8px; }
.cet-ai-row-main .cet-btn { width: 100%; }
.cet-ai-row-main .cet-select { flex: 1 1 auto; }
.cet-regen { display: flex; flex-direction: column; gap: 8px; }
.cet-stale {
    font-size: 12.5px; line-height: 1.45; padding: 10px 12px; border-radius: 10px;
    background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
}

.cet-subjects { display: flex; flex-direction: column; gap: 6px; }
.cet-suggestion {
    text-align: left; min-height: 44px; padding: 10px 12px;
    border: 1px solid #ddd6fe; border-radius: 10px; background: #f5f3ff; color: #4c1d95;
    font-size: 14px; cursor: pointer; transition: background .15s ease;
}
.cet-suggestion:hover { background: #ede9fe; }

.cet-note {
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px 12px; border-radius: 10px;
    background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; font-size: 13px; line-height: 1.45;
}
.cet-note--warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.cet-note-row { display: flex; flex-direction: column; gap: 8px; }
.cet-diff summary { cursor: pointer; font-weight: 600; font-size: 12.5px; }
.cet-diff-body {
    margin-top: 6px; max-height: 260px; overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.5;
    background: #fff; border: 1px solid var(--cet-border); border-radius: 8px; padding: 6px 8px;
}
.cet-diff-line { white-space: pre-wrap; word-break: break-word; padding: 0 4px; border-radius: 3px; color: #475569; }
.cet-diff-add { background: #dcfce7; color: #14532d; }
.cet-diff-del { background: #fee2e2; color: #7f1d1d; text-decoration: line-through; }

/* selector temă */
.cet-themes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cet-theme {
    display: flex; flex-direction: column; align-items: stretch; gap: 6px;
    padding: 8px; border: 2px solid var(--cet-border); border-radius: 12px; background: #fff;
    cursor: pointer; text-align: left; transition: border-color .15s ease, box-shadow .15s ease;
}
.cet-theme:hover { border-color: #bae6fd; }
.cet-theme.is-active { border-color: var(--cet-primary); box-shadow: 0 0 0 3px rgba(14, 165, 233, .18); }
.cet-theme-mini { display: block; border-radius: 8px; padding: 8px; height: 64px; box-sizing: border-box; }
.cet-theme-mini-card {
    display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 6px; border-radius: 5px; box-sizing: border-box;
}
.cet-theme-mini-card i { display: block; height: 5px; border-radius: 3px; width: 100%; }
.cet-theme-mini-card b { display: block; height: 8px; width: 40%; border-radius: 4px; margin-top: auto; }
.cet-theme-name { font-size: 13px; font-weight: 700; color: var(--cet-text); }
.cet-theme-desc { font-size: 11.5px; color: var(--cet-muted); line-height: 1.35; }

/* blocuri */
.cet-blocks { display: flex; flex-direction: column; gap: 8px; }
.cet-block {
    border: 1px solid var(--cet-border); border-radius: 10px; padding: 10px; background: var(--cet-bg-soft);
    display: flex; flex-direction: column; gap: 8px;
}
.cet-block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cet-block-type { font-size: 12.5px; font-weight: 700; color: #334155; display: inline-flex; align-items: center; gap: 6px; }
.cet-block-type i {
    font-style: normal; width: 22px; height: 22px; border-radius: 6px; background: #e2e8f0; color: #0f172a;
    display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.cet-block-tools { display: flex; gap: 4px; }
.cet-block-tools button {
    width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--cet-border); background: #fff;
    color: #334155; font-size: 16px; cursor: pointer; touch-action: manipulation;
}
.cet-block-tools button:hover:not(:disabled) { background: #f1f5f9; }
.cet-block-tools button:disabled { opacity: .35; cursor: default; }
.cet-block-tools .cet-block-del { color: #b91c1c; }
.cet-block textarea { min-height: 44px; resize: vertical; font-size: 14px; }
.cet-block .cet-input { font-size: 14px; }
.cet-block-divider { text-align: center; color: var(--cet-muted); font-size: 12px; padding: 4px; }

/* preview */
.cet-preview-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cet-seg { display: inline-flex; border: 1px solid var(--cet-border); border-radius: 10px; overflow: hidden; background: #fff; }
.cet-seg-btn {
    min-height: 40px; padding: 6px 12px; border: none; background: transparent; color: #334155;
    font-size: 13px; font-weight: 600; cursor: pointer; touch-action: manipulation;
}
.cet-seg-btn.is-active { background: var(--cet-primary); color: #fff; }
.cet-preview-status { font-size: 12px; color: var(--cet-muted); }
.cet-preview-status.is-busy { color: #b45309; }
.cet-preview-status.is-ok { color: #15803d; }
.cet-preview-status.is-error { color: #b91c1c; font-weight: 600; }
.cet-preview-meta { font-size: 12.5px; color: #334155; display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; word-break: break-word; }
.cet-preview-meta span { color: var(--cet-muted); }
.cet-preview-frame-wrap {
    width: 100%; overflow-x: auto; overflow-y: hidden;
    display: flex; justify-content: center;
    padding: 10px 0;
    background:
        linear-gradient(90deg, rgba(0,0,0,.035) 1px, transparent 1px) 0 0 / 14px 14px,
        linear-gradient(rgba(0,0,0,.035) 1px, transparent 1px) 0 0 / 14px 14px, #f1f5f9;
    border: 1px solid var(--cet-border); border-radius: 12px;
}
.cet-preview-frame {
    width: 375px; max-width: 100%; height: 560px;
    border: none; border-radius: 10px; background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .18);
    transition: width .2s ease;
}
.cet-preview-frame-wrap.is-desktop { justify-content: flex-start; }

/* --------------------------------------------------------------------------
   Dialog mic (confirmări, „trimite test către…", 409 legături)
   -------------------------------------------------------------------------- */
.cet-dialog-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px);
    display: flex; align-items: flex-end; justify-content: center;
    padding: 0;
}
.cet-dialog {
    width: 100%; max-width: 520px; background: #fff;
    border-radius: 16px 16px 0 0; padding: 18px 16px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; gap: 12px;
    animation: cet-slide-up .2s ease;
    max-height: 90vh; overflow-y: auto;
}
.cet-dialog h4 { margin: 0; font-size: 17px; color: var(--cet-text); }
.cet-dialog-body { font-size: 14px; color: #334155; line-height: 1.5; }
.cet-dialog-body p { margin: 0 0 8px; }
.cet-dialog-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
.cet-dialog-actions .cet-btn { width: 100%; }
.cet-usedby { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--cet-text); }
.cet-usedby li { margin-bottom: 4px; }
.cet-usedby span { color: var(--cet-muted); }

/* --------------------------------------------------------------------------
   ≥ 640px: două butoane pe rând în footer/dialog, grilă de exemple pe 3
   -------------------------------------------------------------------------- */
@media (min-width: 640px) {
    .cet-toolbar { flex-direction: row; align-items: center; justify-content: space-between; }
    .cet-btn-new { width: auto; }
    .cet-cards { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
    .cet-examples { grid-template-columns: repeat(3, 1fr); }
    .cet-card-actions { grid-template-columns: repeat(4, 1fr); }
    .cet-cols-2 { grid-template-columns: 1fr 1fr; }
    .cet-ai-row-main { flex-direction: row; align-items: center; }
    .cet-ai-row-main .cet-btn { width: auto; }
    .cet-regen { flex-direction: row; }
    .cet-regen .cet-btn { flex: 0 0 auto; }
    .cet-note-row { flex-direction: row; align-items: center; justify-content: space-between; }
    .cet-editor-foot { grid-template-columns: auto auto auto; justify-content: flex-end; }
    .cet-editor-foot .cet-btn { width: auto; }
    .cet-dialog-overlay { align-items: center; padding: 16px; }
    .cet-dialog { border-radius: 16px; padding: 22px; }
    .cet-dialog-actions { grid-template-columns: auto auto; justify-content: flex-end; }
    .cet-dialog-actions .cet-btn { width: auto; }
    .cet-themes { grid-template-columns: repeat(4, 1fr); }
}

/* --------------------------------------------------------------------------
   ≥ 1024px: editorul devine fereastră mare cu două coloane (editare | preview)
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
    .cet-overlay { padding: 20px; align-items: center; }
    .cet-editor {
        width: min(1400px, 100%); height: min(94vh, 100%);
        border-radius: 16px; box-shadow: 0 30px 80px rgba(15, 23, 42, .35);
    }
    .cet-editor-head { padding: 14px 20px; }
    .cet-editor-head h3 { font-size: 18px; }
    .cet-editor-head-actions [data-cet="send-test"],
    .cet-editor-head-actions [data-cet="save"] { display: inline-flex; }
    .cet-editor-foot { display: none; }             /* acțiunile sunt în antet pe desktop */

    .cet-editor-body {
        flex-direction: row; overflow: hidden;
    }
    .cet-pane { padding: 20px; overflow-y: auto; min-height: 0; }
    .cet-pane-edit { flex: 1 1 58%; min-width: 0; }
    .cet-pane-preview {
        flex: 0 0 42%; max-width: 680px; border-top: none; border-left: 1px solid var(--cet-border);
        display: flex; flex-direction: column;
    }
    .cet-preview-frame-wrap { flex: 1 1 auto; min-height: 0; align-items: flex-start; }
    .cet-preview-frame { height: 100%; min-height: 520px; }
    .cet-preview-frame-wrap.is-desktop { justify-content: center; }
    .cet-themes { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1280px) {
    .cet-themes { grid-template-columns: repeat(4, 1fr); }
}

/* Reduce animațiile dacă utilizatorul a cerut asta */
@media (prefers-reduced-motion: reduce) {
    .cet-editor, .cet-dialog { animation: none; }
    .cet-btn, .cet-chip, .cet-card, .cet-example { transition: none; }
}
