.editor-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box; 
}

.subject-input {
    width: 100%;
    padding: 0.8em;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

#editor-textarea {
    width: 100%;
    min-height: 40vh;
    padding: 12px;
    font-family: monospace;
    /* Font size minimum at 16px to inhibit native auto-zoom scaling on iOS Safari */
    font-size: 16px; 
    border: 1px solid #ccc;
    box-sizing: border-box;
    resize: vertical;
}

.bbcode-toolbar {
    display: flex;
    overflow-x: auto;
    background: #e9ecef;
    padding: 8px 4px;
    /* Sticky implementation locks interface position relative to mobile virtual keyboard */
    position: sticky;
    bottom: 0;
    z-index: 50;
    border-bottom: 1px solid #ccc;
    gap: 3px;
}

.bbcode-btn {
    /* Touch Target Optimization: Strict adherence to the 44x44px ergonomic standard */
    min-width: 32px;
    padding: 2px;
    background-color: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    /* Disables 300ms double-tap delay in mobile browser viewports */
    touch-action: manipulation;
}

.editor-actions {
    display: flex;
    justify-content: end;
    gap: 0.5rem;
    margin-top: 1em;
}

.editor-actions button {
    min-height: 32px;
    flex: 0;
    font-size: 1rem;
    cursor: pointer;
    padding: 0 0.6em;
}

#preview-container {
    margin-top: 1em;
    padding: 1em;
    border: 2px dashed gray;
}

.noeditor {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 215px);
    min-height: calc(100dvh - 215px);
}

.noeditor .message {
    text-align: center;
    padding: 10%;
}