/**
 * SecureHold Email Editor Styles
 * Version: 3.11.0
 */

/* ============================================
   HIDE SETTINGS SIDEBAR ON NOTIFICATIONS TAB
   ============================================ */
/* Hide the sidebar when on notifications tab */
.securehold-tab-notifications .sh-settings-sidebar {
    display: none !important;
}

/* Make the content take full width on notifications tab */
.securehold-tab-notifications form > div {
    grid-template-columns: 1fr !important;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */

/*
 * Outer wrapper: flex COLUMN so it occupies the viewport height.
 * min-height (no explicit height) lets it grow beyond the viewport
 * when content is taller, avoiding a second scroll bar.
 */
.sh-notifications-wrapper {
    display: flex;
    flex-direction: column;
    margin-top: 2rem;
    min-height: calc(100vh - var(--wp-admin--admin-bar--height, 32px) - 4rem);
}

/*
 * Inner row: the actual two-column layout.
 *
 * flex:1         → fills all remaining vertical space in the wrapper.
 * min-height:0   → CRITICAL. Without this, a flex item in a column flex
 *                  container cannot shrink below its content height, which
 *                  prevents the columns from enabling internal scroll.
 *                  Setting min-height:0 lets the flex algorithm size the row
 *                  to the available space rather than its content height.
 * align-items:stretch → both columns fill the row height automatically,
 *                       no height:100% hacks required.
 */
.sh-notifications-layout {
    display: flex;
    align-items: stretch;
    gap: 2rem;
    flex: 1;
    min-height: 0;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sh-emails-sidebar {
    /* Fixed sidebar width.
       align-items:stretch on .sh-notifications-layout sizes the height
       automatically — no height:100% hack required. */
    width: 320px;
    flex-shrink: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    /* Inner flex-column so header/master-settings are fixed and .sh-emails-list
       fills remaining space with internal scroll. */
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sh-sidebar-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f9fafb 0%, #fff 100%);
    border-bottom: 2px solid #e5e7eb;
}

.sh-sidebar-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: #111827;
}

.sh-sidebar-header p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.sh-emails-list {
    /* Fill the sidebar's remaining height; scroll internally (Task F) */
    flex: 1;
    min-height: 0;          /* allow flex item to shrink below content height */
    overflow-y: auto;
}

/* Email Category */
.sh-email-category {
    border-bottom: 1px solid #e5e7eb;
}

.sh-email-category:last-child {
    border-bottom: none;
}

.sh-category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: #f9fafb;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.sh-category-header .dashicons {
    color: #2563eb;
}

/* Email Item */
.sh-email-item {
    display: block;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sh-email-item:hover {
    background: #f9fafb;
    border-left-color: #2563eb;
}

.sh-email-item.active {
    background: #eff6ff;
    border-left-color: #2563eb;
}

.sh-email-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.sh-email-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #111827;
}

.sh-email-status {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.sh-email-status.enabled {
    background: #d1fae5;
    color: #059669;
}

.sh-email-status.disabled {
    background: #fee2e2;
    color: #dc2626;
}

.sh-email-status .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.sh-email-description {
    margin: 0;
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.4;
}

/* ============================================
   EMAIL EDITOR
   ============================================ */
.sh-email-editor {
    /* Takes all remaining horizontal space.
       No padding on the card itself — the header and form carry their own
       padding, which lets the form scroll cleanly without the scrollbar being
       inset from the card edges.
       overflow:hidden preserves the border-radius clip on child backgrounds. */
    flex: 1;
    min-width: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sh-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f9fafb 0%, #fff 100%);
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.sh-editor-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: #111827;
}

.sh-editor-header p {
    margin: 0;
    font-size: 0.9375rem;
    color: #6b7280;
}

/* Toggle Switch */
.sh-toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.sh-toggle-switch input {
    /* Visually hidden but still checkable via the parent <label> click.
       width/height:0 + pointer-events:none prevent the invisible input from
       capturing mouse events so the :checked+sibling CSS transition fires
       correctly on every click (Task F — toggle knob animation). */
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.sh-toggle-slider {
    position: relative;
    width: 48px;
    height: 24px;
    background: #d1d5db;
    border-radius: 24px;
    /* Animate only the background to avoid interfering with :before transition (Task 4) */
    transition: background 0.3s ease;
    flex-shrink: 0; /* prevent slider from collapsing inside flex containers */
}

/* Knob — use :before so input:checked + .sh-toggle-slider:before selector resolves
   correctly in all browsers regardless of specificity stacking (Task 4). */
.sh-toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.sh-toggle-switch input:checked + .sh-toggle-slider {
    background: #10b981;
}

.sh-toggle-switch input:checked + .sh-toggle-slider::before {
    transform: translateX(24px);
}

.sh-toggle-label {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #374151;
}

/* ============================================
   FORM
   ============================================ */
/* Scroll container: flex:1 fills the card after the fixed header;
   min-height:0 allows it to shrink below content height (critical for
   flex children); overflow-y:auto gives fields their own scroll track. */
.sh-editor-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Padded inner wrapper: separates fields from the card edges.
   box-sizing:border-box prevents the padding from widening the container
   beyond its parent's bounds. */
.sh-editor-inner {
    padding: 1.5rem 2rem;
    box-sizing: border-box;
}

.sh-form-group {
    margin-bottom: 2rem;
}

.sh-form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #374151;
    margin-bottom: 0.75rem;
}

.sh-form-label .dashicons {
    color: #2563eb;
}

.sh-form-input,
.sh-form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    font-family: inherit;
    /* Prevent width:100% + padding from overflowing the form's padded column. */
    box-sizing: border-box;
}

/* Scoped overflow guard — belt-and-suspenders rule so any input or textarea
   inside the editor card can never escape the padded .sh-editor-inner column,
   regardless of where it comes from (WP core, plugin injections, etc.). */
.sh-email-editor input[type="text"],
.sh-email-editor textarea,
.sh-email-editor .sh-form-input,
.sh-email-editor .sh-form-textarea {
    box-sizing: border-box;
    max-width: 100%;
}

.sh-form-input:focus,
.sh-form-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.sh-form-hint {
    margin: 0.5rem 0 0 0;
    font-size: 0.8125rem;
    color: #6b7280;
}

/* Editor Toolbar */
.sh-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.sh-editor-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sh-editor-btn:hover {
    background: #f3f4f6;
    border-color: #2563eb;
    color: #2563eb;
}

.sh-editor-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.sh-toolbar-separator {
    width: 1px;
    height: 24px;
    background: #d1d5db;
    margin: 0 0.5rem;
}

/* Active state: button reflects current cursor formatting context */
.sh-editor-btn.sh-editor-btn-active {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
}

/* Block-format segmented control (P / H2 / H3) */
.sh-block-format-group {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
}

.sh-block-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.55rem;
    background: white;
    border: none;
    border-right: 1px solid #d1d5db;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
    min-width: 2rem;
}

.sh-block-btn:last-child {
    border-right: none;
}

.sh-block-btn:hover {
    background: #f3f4f6;
    color: #2563eb;
}

.sh-block-btn.sh-editor-btn-active {
    background: #eff6ff;
    color: #2563eb;
}

/* Editor Content */
.sh-email-editor-content {
    min-height: 400px;
    padding: 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 0 0 8px 8px;
    font-size: 0.9375rem;
    line-height: 1.6;
    background: white;
    overflow-y: auto;
}

.sh-email-editor-content:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Full color reset: prevents WP admin / WooCommerce global styles from
   leaking blue or other colours into the Simple editor content area. */
.sh-email-editor-content,
.sh-email-editor-content p,
.sh-email-editor-content h1,
.sh-email-editor-content h2,
.sh-email-editor-content h4,
.sh-email-editor-content h5,
.sh-email-editor-content h6,
.sh-email-editor-content li {
    color: #111827;
}

.sh-email-editor-content a {
    color: #111827;
}

.sh-email-editor-content p {
    margin: 0 0 1rem 0;
}

.sh-email-editor-content ul,
.sh-email-editor-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.sh-email-editor-content h3 {
    color: #111827;
    margin: 1.5rem 0 1rem 0;
}

/* ============================================
   SIMPLE EDITOR: BULLET / LIST VISIBILITY
   WP admin globally resets list-style to none.
   These rules restore visible bullet markers
   inside #sh-email-body (the Simple-mode
   contenteditable) without affecting the page.
   ============================================ */
#sh-email-body ul {
    list-style-type: disc !important;
    padding-left: 2em !important;
    margin: 0.4em 0 !important;
}

#sh-email-body ol {
    list-style-type: decimal !important;
    padding-left: 2em !important;
    margin: 0.4em 0 !important;
}

#sh-email-body li {
    display: list-item !important;
    list-style-position: outside;
}

/* Form Actions — sits outside .sh-editor-scroll so buttons stay anchored
   at the card bottom. Left/right padding mirrors .sh-editor-inner so the
   button row aligns visually with the fields above. */
.sh-form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1rem 2rem 1.5rem;
    border-top: 2px solid #e5e7eb;
    box-sizing: border-box;
}

/* ============================================
   VARIABLES SIDEBAR
   ============================================ */
.sh-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    display: flex;
    justify-content: flex-end;
}

.sh-sidebar-panel {
    width: 400px;
    background: white;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.sh-sidebar-panel .sh-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.sh-sidebar-panel .sh-sidebar-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #111827;
}

.sh-sidebar-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #6b7280;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.sh-sidebar-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.sh-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.sh-sidebar-description {
    padding: 1rem;
    background: #eff6ff;
    border-left: 3px solid #2563eb;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #1e40af;
    margin-bottom: 1.5rem;
}

/* Variable Category */
.sh-variable-category {
    margin-bottom: 2rem;
}

.sh-variable-category h4 {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.sh-variables-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sh-variable-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.sh-variable-item:hover {
    background: #eff6ff;
    border-color: #2563eb;
}

.sh-variable-item code {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #2563eb;
    font-weight: 600;
    flex-shrink: 0;
}

.sh-variable-item span {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-left: 1rem;
}

/* ============================================
   MODALS
   ============================================ */
.sh-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.sh-modal-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 0.3s ease;
}

.sh-modal-container.sh-modal-small {
    max-width: 500px;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.sh-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #e5e7eb;
}

.sh-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #111827;
}

.sh-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.sh-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 2px solid #e5e7eb;
    background: #f9fafb;
}

/* ============================================
   NOTIFICATIONS
   ============================================ */
.sh-notification {
    position: fixed;
    top: 32px;
    right: -400px;
    min-width: 300px;
    max-width: 400px;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 9999999;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: right 0.3s ease;
}

.sh-notification.show {
    right: 20px;
}

.sh-notification-success {
    border-left: 4px solid #10b981;
}

.sh-notification-error {
    border-left: 4px solid #ef4444;
}

.sh-notification .dashicons {
    font-size: 24px;
    flex-shrink: 0;
}

.sh-notification-success .dashicons {
    color: #10b981;
}

.sh-notification-error .dashicons {
    color: #ef4444;
}

/* ============================================
   MASTER NOTIFICATION SETTINGS
   ============================================ */
.sh-master-settings {
    padding: 14px 16px 10px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.sh-master-settings h4 {
    margin: 0 0 10px 0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
}

.sh-master-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
}

.sh-master-toggle-label {
    font-size: 13px;
    color: #2c3338;
}

/* ============================================
   COMING SOON
   ============================================ */
.sh-email-status.coming-soon {
    background: #fef3c7;
    color: #d97706;
}

.sh-coming-soon-panel {
    /* flex:1 fills the editor card's remaining height (after the header)
       so the centred content sits in the middle of the full card. */
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: #6b7280;
}

.sh-coming-soon-icon .dashicons {
    font-size: 56px;
    width: 56px;
    height: 56px;
    color: #d97706;
    margin-bottom: 1.5rem;
}

.sh-coming-soon-panel h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #374151;
}

.sh-coming-soon-panel p {
    margin: 0;
    font-size: 0.9375rem;
    max-width: 380px;
    line-height: 1.6;
}

/* ============================================
   TASK 3 — EDITOR MODE TOGGLE
   ============================================ */
.sh-body-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.sh-editor-mode-toggle {
    display: flex;
    gap: 0;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.sh-mode-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.875rem;
    background: white;
    border: none;
    border-right: 1px solid #e5e7eb;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.sh-mode-btn:last-child {
    border-right: none;
}

.sh-mode-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.sh-mode-btn.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

.sh-mode-btn .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
}

/* ============================================
   TASK 3 — CODE EDITOR (CodeMirror)
   ============================================ */
.sh-code-editor-wrap {
    border-radius: 0 0 8px 8px;
}

.sh-code-toolbar {
    border-radius: 8px 8px 0 0;
    border-bottom: none;
}

/* Override CodeMirror defaults for email body height */
.sh-code-editor-wrap .CodeMirror {
    height: 420px;
    font-size: 13px;
    font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
    line-height: 1.5;
    border: 2px solid #e5e7eb;
    border-radius: 0 0 8px 8px;
    transition: border-color 0.2s ease;
}

.sh-code-editor-wrap .CodeMirror-focused {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.sh-code-editor-wrap .CodeMirror-scroll {
    min-height: 380px;
}

/* ============================================
   PREVIEW MODAL — open/close state
   ID specificity overrides any WP-admin or
   plugin rule that forces opacity:0 or
   pointer-events:none on fixed overlays.
   ============================================ */

/* Base (hidden) state — inline style="display:none" on the element
   starts it hidden; clearing the inline style lets this rule take over. */
#sh-preview-modal.sh-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

/* Open state — JS adds .is-open to reveal and make interactive. */
#sh-preview-modal.sh-modal-overlay.is-open {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

/* Container — override generic .sh-modal-container sizing for preview. */
#sh-preview-modal .sh-modal-container {
    width: min(1100px, 100%);
    max-height: calc(100vh - 48px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Suppress the generic modalFadeIn animation — opacity is controlled
       by the overlay transition so the container should always be opaque. */
    animation: none;
}

/* Iframe scroll host */
#sh-preview-modal .sh-preview-modal-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 16px;
}

/* Sandboxed preview frame */
.sh-preview-frame {
    width: 100%;
    height: 70vh;
    border: 0;
    background: #fff;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1280px) {
    /* Stack columns vertically on narrower screens */
    .sh-notifications-layout {
        flex-direction: column;
    }

    .sh-emails-sidebar {
        width: 100%;
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .sh-sidebar-panel {
        width: 100%;
    }

    .sh-modal-container {
        max-width: 100%;
        margin: 1rem;
    }

    .sh-body-label-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 782px) {
    /* 1. Email list sidebar: taller so more items are readable without scrolling */
    .sh-emails-sidebar {
        max-height: 60vh;
        min-height: 240px;
    }

    /* 2. Editor toolbar: wrap buttons so Variables / Preview stay inside viewport */
    .sh-editor-toolbar {
        flex-wrap: wrap;
    }

    /* 3. Bottom action buttons: stack vertically, each full width */
    .sh-form-actions {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 1.25rem 1.25rem;
    }

    .sh-form-actions .sh-btn {
        width: 100%;
        justify-content: center;
    }
}
