.md-wysiwyg-editor-wrapper {
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.md-toolbar {
    background-color: #f7f7f7;
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.md-toolbar-button {
    padding: 6px 8px;
    border: 1px solid #ccc;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 30px;
}

.md-toolbar-button:hover {
    background-color: #e9e9e9;
    border-color: #bbb;
}

.md-toolbar-button.active {
    background-color: #d0e4ff;
    border-color: #007bff;
    color: #0056b3;
}

.md-toolbar-button svg {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.md-editor-content-area {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 500px;
}

.md-editable-area {
    height: 100%;
    overflow-y: auto;
    padding: 15px;
    outline: none;
    word-wrap: break-word;
    font-size: 15px;
    line-height: 1.7;
    width: 100%;
    box-sizing: border-box;
    border: none;
    background-color: #fff;
}

.md-editable-area h1 {
    font-size: 2em;
    font-weight: bold;
    margin-top: 0.67em;
    margin-bottom: 0.67em;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.3em;
}

.md-editable-area h2 {
    font-size: 1.5em;
    font-weight: bold;
    margin-top: 0.83em;
    margin-bottom: 0.83em;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.3em;
}

.md-editable-area h3 {
    font-size: 1.17em;
    font-weight: bold;
    margin-top: 1em;
    margin-bottom: 1em;
}

.md-editable-area p {
    margin-bottom: 1em;
}

.md-editable-area strong,
.md-editable-area b {
    font-weight: bold;
}

.md-editable-area em,
.md-editable-area i {
    font-style: italic;
}

.md-editable-area s,
.md-editable-area del {
    text-decoration: line-through;
}

.md-editable-area a {
    color: #0366d6;
    text-decoration: underline;
}

.md-editable-area ul,
.md-editable-area ol {
    margin-left: 20px;
    margin-bottom: 1em;
}

.md-editable-area li {
    margin-bottom: 0.2em;
}

.md-editable-area blockquote {
    border-left: 3px solid #007bff;
    margin-left: 0;
    padding-left: 1em;
    color: #555;
    font-style: italic;
    margin-bottom: 1em;
}

.md-editable-area blockquote p {
    margin-bottom: 0.5em;
}

.md-editable-area pre {
    background-color: #f0f0f0;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'Menlo', 'Consolas', monospace;
    font-size: 0.9em;
    margin-bottom: 1em;
    white-space: pre;
}

.md-editable-area code {
    font-family: 'Menlo', 'Consolas', monospace;
    background-color: #f0f0f0;
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

.md-editable-area pre code {
    background-color: transparent;
    padding: 0;
    font-size: inherit;
}

.md-editable-area hr {
    margin-top: 1em;
    margin-bottom: 1em;
    border: 0;
    border-top: 1px solid #eee;
}

.md-editable-area table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1em;
    border: 1px solid #ddd;
}

.md-editable-area th,
.md-editable-area td {
    border: 1px solid #ddd;
    padding: 8px 10px;
    text-align: left;
    min-width: 50px;
}

.md-editable-area th {
    background-color: #f7f7f7;
    font-weight: bold;
}

.md-editable-area td:empty::before,
.md-editable-area th:empty::before {
    content: "\200B";
}

.md-markdown-editor-container {
    display: flex;
    height: 100%;
    background-color: #fff;
    color: #333;
    font-family: 'Menlo', 'Consolas', monospace;
    display: none;
    width: 100%;
    box-sizing: border-box;
}

.md-markdown-line-numbers {
    padding: 15px 10px 15px 15px;
    text-align: right;
    user-select: none;
    background-color: #f7f7f7;
    color: #888;
    border-right: 1px solid #ddd;
    overflow: hidden;
    box-sizing: border-box;
}

.md-markdown-textarea-wrapper {
    flex-grow: 1;
    position: relative;
    height: 100%;
    overflow: hidden;
}

.md-markdown-area {
    height: 100%;
    width: 100%;
    padding: 15px;
    border: none;
    outline: none;
    resize: none;
    background-color: transparent;
    color: inherit;
    font-family: inherit;
    box-sizing: border-box;
    overflow-y: auto;
}


.md-tabs {
    display: flex;
    border-top: 1px solid #ddd;
    background-color: #f7f7f7;
}

.md-tab-button {
    padding: 10px 15px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    border-right: 1px solid #ddd;
}

.md-tab-button:last-child {
    border-right: none;
}

.md-tab-button.active {
    background-color: #fff;
    color: #007bff;
    font-weight: bold;
    border-bottom: 2px solid #007bff;
    margin-bottom: -1px;
}

.md-tab-button:hover:not(.active) {
    background-color: #e9e9e9;
}

.md-table-grid-selector {
    position: absolute;
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px;
    z-index: 1050;
    border-radius: 4px;
    display: none;
}

.md-table-grid-cells-container {
    display: grid;
    grid-gap: 2px;
}

.md-table-grid-cell {
    width: 18px;
    height: 18px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    cursor: pointer;
    box-sizing: border-box;
}

.md-table-grid-cell.highlighted {
    background-color: #cce5ff;
    border-color: #007bff;
}

.md-table-grid-label {
    text-align: center;
    margin-top: 8px;
    font-size: 13px;
    color: #555;
}

.md-contextual-table-toolbar {
    position: absolute;
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 5px;
    z-index: 1060;
    border-radius: 4px;
    display: none;
    gap: 3px;
    flex-wrap: nowrap;
}

.md-contextual-table-toolbar-button {
    padding: 4px 6px;
    border: 1px solid #ccc;
    background-color: #fff;
    border-radius: 3px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
    transition: background-color 0.2s ease;
}

.md-contextual-table-toolbar-button:hover {
    background-color: #e9e9e9;
    border-color: #bbb;
}

.md-contextual-table-toolbar-button svg {
    width: 16px;
    height: 16px;
}

.md-image-dialog {
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    min-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background-color: #fff; /* Ensure background for dialog */
    color: #333; /* Ensure text color for dialog */
}

/* Optional: Styling for the dialog's backdrop */
.md-image-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.4);
}

.md-image-dialog-heading {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

.md-image-dialog-label {
    display: block;
    margin-bottom: 5px;
    font-weight: normal; /* Match general label style */
    font-size: 14px;
    color: #555;
}

.md-image-dialog-input {
    width: 100%;
    padding: 8px 10px; /* Consistent padding */
    margin-bottom: 15px;
    box-sizing: border-box;
    border: 1px solid #ddd; /* Consistent border */
    border-radius: 4px; /* Consistent radius */
    font-size: 14px;
    background-color: #fff;
    color: #333;
}

.md-image-dialog-input:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.md-image-dialog-footer {
    text-align: right;
    margin-top: 20px;
    display: flex; /* For button spacing */
    justify-content: flex-end; /* Align buttons to the right */
    gap: 10px; /* Space between buttons */
}

.md-image-dialog-button {
    padding: 8px 15px; /* Slightly more padding for buttons */
    border: 1px solid #ccc;
    background-color: #f7f7f7; /* Match toolbar button default */
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    min-width: 80px; /* Give buttons a decent min-width */
}

.md-image-dialog-button:hover {
    background-color: #e9e9e9;
    border-color: #bbb;
}

.md-image-dialog-button-primary {
    background-color: #007bff; /* Primary action color */
    color: white;
    border-color: #007bff;
}

.md-image-dialog-button-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}