/* ==========================================================================
   🧱 MODULE KEY FRAMEWORK LAYER (ENTERPRISE WYSIWYG RESILIENT SUITE)
   ========================================================================== */

/* Outer wrapper framework box wrapped dynamically around the input field */
.wysiwyg-wrapper-container {
    width: 100%;
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
    transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
    overflow: hidden;
    box-sizing: border-box;
}

/* Active focus boundary ring mapping matching modern user interface standards */
.wysiwyg-wrapper-container:focus-within {
    border-color: #66afe9;
    outline: 0;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
}

/* Horizontal control panel containing buttons and select dropdown elements */
.wysiwyg-custom-toolbar {
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    padding: 6px 10px;
    display: flex;
    flex-wrap: wrap; /* Permits buttons to loop down gracefully on narrow smart displays */
    gap: 4px;
    align-items: center;
    box-sizing: border-box;
}

/* Typography, sizing, spacing, and select dropdown components layer */
.wysiwyg-toolbar-select {
    height: 28px;
    padding: 2px 6px;
    font-size: 12px;
    line-height: 1.5;
    border: 1px solid #ccc;
    border-radius: 3px;
    background-color: #fff;
    color: #555;
    cursor: pointer;
    outline: none;
    font-weight: 500;
    font-family: inherit;
    box-sizing: border-box;
}

.wysiwyg-toolbar-select:focus {
    border-color: #66afe9;
}

/* Vertical borders dividing button command blocks */
.wysiwyg-toolbar-divider {
    width: 1px;
    height: 18px;
    background-color: #ddd;
    margin: 0 4px;
    flex-shrink: 0;
}

/* Standard tool control action item buttons mapping */
.wysiwyg-custom-btn {
    padding: 5px 8px;
    background-color: transparent;
    border: 1px solid transparent;
    color: #444;
    cursor: pointer;
    border-radius: 3px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease-in-out;
    box-sizing: border-box;
}

.wysiwyg-custom-btn:hover {
    background-color: #e6e6e6;
    border-color: #adadad;
    color: #333;
}

/* 🎯 THE ACTIVE STATE BUTTON TOGGLE PROFILE
   Turns soft light blue with a clean dark blue font when formatting targets match criteria */
.wysiwyg-custom-btn.is-active {
    background-color: #e2f0fd !important;
    border-color: #b3d7f7 !important;
    color: #0b66c3 !important;
}

/* FontAwesome glyph alignment and icon boundary restraints */
.wysiwyg-custom-btn i {
    font-size: 13px;
    display: inline-block;
    line-height: 1;
    vertical-align: middle;
}

/* ==========================================================================
   📊 INTERACTIVE VISUAL GRAPH TABLE PICKER OVERLAY POPUP
   ========================================================================== */

.wysiwyg-table-dropdown-container {
    position: relative;
    display: inline-block;
}

/* Floating overlay popover matrix menu configurations */
.wysiwyg-table-picker-popover {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    padding: 8px;
    z-index: 1050;
    display: none; /* Invisible by default initialization states */
    box-sizing: border-box;
}

/* Active window visibility selector rules overlay */
.wysiwyg-table-picker-popover.is-visible {
    display: block !important;
}

/* 5x5 Grid block container metrics mapping */
.wysiwyg-table-grid-matrix {
    display: grid;
    grid-template-columns: repeat(5, 18px);
    grid-template-rows: repeat(5, 18px);
    gap: 3px;
    cursor: pointer;
}

/* Standalone empty matrix layout cell box profiles */
.wysiwyg-matrix-cell {
    width: 18px;
    height: 18px;
    background: #fdfdfd;
    border: 1px solid #ddd;
    border-radius: 2px;
    box-sizing: border-box;
    transition: background 0.05s ease;
}

/* 🎯 INTERACTIVE HIGHLIGHT VECTOR ZONE
   Highlights tracking blocks blue seamlessly during mouse move operations */
.wysiwyg-matrix-cell.is-highlighted {
    background-color: #e2f0fd !important;
    border-color: #8bbef9 !important;
}

/* Size label text metrics row (e.g. "2 x 2") */
.wysiwyg-table-matrix-label {
    margin-top: 8px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    color: #444;
    text-align: left;
    padding-left: 2px;
}

/* ==========================================================================
   🎯 ACTIVE RICH TEXT WORKING EDITABLE CANVASES LAYERS
   ========================================================================== */

.wysiwyg-custom-editor {
    padding: 12px 14px;
    outline: none;
    overflow-y: auto;
    color: #333;
    font-family: Arial, Calibri, sans-serif;
    font-size: 16px; /* Hard-locked to 16px to permanently bypass mobile zooming bugs */
    line-height: 1.25;
    background: #fff;
    box-sizing: border-box;
}

/* Trims deep paragraph constraints to support natural corporate line splits */
.wysiwyg-custom-editor p {
    margin: 0 0 4px;
    line-height: inherit;
}

.wysiwyg-custom-editor br {
    line-height: inherit;
}

/* Fallback variable text string attributes placeholder bindings */
.wysiwyg-custom-editor[contenteditable="true"]:empty:before {
    content: attr(data-placeholder);
    color: #999;
    pointer-events: none;
    display: block;
}

/* 📊 STABLE LEFT INDENTATION GAPS ADJUSTMENTS
   Pulls sequential bullets and line numbers tightly into columns matching previous UI maps */
.wysiwyg-custom-editor ul, 
.wysiwyg-custom-editor ol {
    padding-left: 20px !important; /* Pulls indicators safely clear of massive unstyled tracking breaks */
    margin-top: 0;
    margin-bottom: 6px;
}

.wysiwyg-custom-editor li {
    margin-bottom: 2px;
    line-height: inherit;
}

/* 📊 RESILIENT GRID TABLE EDITING BLOCKS
   Enforces fluid dynamic sizing structures and thin dark gray line tracking */
.wysiwyg-custom-editor table {
    width: 100% !important;
    max-width: 100%;
    margin-top: 12px;
    margin-bottom: 15px;
    border-collapse: collapse;
    border-spacing: 0;
    box-sizing: border-box;
    table-layout: auto; /* Columns scale widths fluidly automatically based on typed values length */
    word-break: break-word; /* Enforces hard wrap rules on variable templates past cell containers */
}

.wysiwyg-custom-editor td,
.wysiwyg-custom-editor th {
    min-width: 45px;
    padding: 8px 10px;
    border: 1px solid #ccc !important;
    vertical-align: top;
    box-sizing: border-box;
}

/* Guards empty document cell points from compressing completely flat */
.wysiwyg-custom-editor td:empty::before {
    content: "\00a0"; /* Secure space markers keep rows solid */
}

/* 📐 FORMULA INLINE FRACTIONS WRAPPERS */
.wysiwyg-math-fraction {
    display: inline-flex;
    flex-direction: column;
    vertical-align: middle;
    text-align: center;
    padding: 0 4px;
    font-size: 0.85em; /* Marginally smaller typography fits clean across normal sentences rows */
    line-height: 1.1;
}

/* Fractional formula dividers line markings */
.wysiwyg-fraction-num {
    border-bottom: 1px solid #444;
    padding-bottom: 1px;
    display: block;
}

.wysiwyg-fraction-den {
    padding-top: 1px;
    display: block;
}

/* Technical hidden masking layer drops raw form field tags views securely */
.wysiwyg-input {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    opacity: 0 !important;
}

/* Dynamic view scale rules downscales text blocks back to a crisp 14px on desktop screens */
@media (min-width: 768px) {
    .wysiwyg-custom-editor {
        font-size: 14px;
    }
}
