.tecz-md-container {
    max-width: 1100px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.tecz-md-header {
    background: #f8fafc;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.tecz-md-header h3 {
    margin: 0 0 5px 0;
    font-size: 1.25rem;
    color: #1e293b;
}

.tecz-md-header p {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
}

.tecz-md-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 500px;
}

.tecz-md-editor-panel {
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    background: #fafafa;
}

.tecz-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
    background: #f1f5f9;
}

.tecz-panel-header label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
    margin: 0;
}

#tecz-md-input {
    flex-grow: 1;
    width: 100%;
    border: none;
    padding: 15px;
    font-family: monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #1e293b;
    background: transparent;
    resize: none;
    box-sizing: border-box;
}

#tecz-md-input:focus {
    outline: none;
}

.tecz-md-output-panel {
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.tecz-md-tabs {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    padding-right: 15px;
}

.tecz-md-tab-btn {
    background: transparent;
    border: none;
    padding: 12px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tecz-md-tab-btn:hover {
    color: #1e293b;
}

.tecz-md-tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background: #ffffff;
}

.tecz-md-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tecz-md-content-area {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
}

.tecz-md-pane {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.tecz-md-pane.active {
    display: block;
}

.tecz-code-output {
    background: #0f172a;
    color: #38bdf8;
    border: none;
    font-family: monospace;
    font-size: 0.9rem;
    resize: none;
    line-height: 1.5;
}

.tecz-code-output:focus {
    outline: none;
}

/* Base styles for the visual preview to resemble a standard webpage */
.tecz-preview-styles {
    color: #334155;
    line-height: 1.6;
    font-size: 1rem;
}

.tecz-preview-styles h1, .tecz-preview-styles h2, .tecz-preview-styles h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #0f172a;
}

.tecz-preview-styles h1 { font-size: 2em; border-bottom: 1px solid #e2e8f0; padding-bottom: 0.3em; }
.tecz-preview-styles h2 { font-size: 1.5em; border-bottom: 1px solid #e2e8f0; padding-bottom: 0.3em; }
.tecz-preview-styles h3 { font-size: 1.25em; }

.tecz-preview-styles p { margin-bottom: 1em; }
.tecz-preview-styles a { color: #3b82f6; text-decoration: none; }
.tecz-preview-styles a:hover { text-decoration: underline; }
.tecz-preview-styles strong { font-weight: 600; }
.tecz-preview-styles em { font-style: italic; }

.tecz-preview-styles ul, .tecz-preview-styles ol {
    margin-bottom: 1em;
    padding-left: 2em;
}

.tecz-preview-styles code {
    background: #f1f5f9;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
    color: #ef4444;
}

.tecz-preview-styles pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1em;
}

.tecz-preview-styles pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.tecz-preview-styles blockquote {
    border-left: 4px solid #cbd5e1;
    margin: 0 0 1em 0;
    padding-left: 1em;
    color: #64748b;
    font-style: italic;
}

.tecz-preview-styles img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.tecz-btn {
    background: #3b82f6;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.tecz-btn:hover { background: #2563eb; }
.tecz-btn-sm { padding: 4px 10px; font-size: 0.8rem; }
.tecz-btn-danger { background: #fee2e2; color: #ef4444; border: 1px solid #fca5a5; }
.tecz-btn-danger:hover { background: #fecaca; }

.tecz-copy-msg {
    color: #10b981;
    font-size: 0.8rem;
    font-weight: 600;
}

@media (max-width: 800px) {
    .tecz-md-grid {
        grid-template-columns: 1fr;
        height: auto;
    }
    #tecz-md-input { min-height: 300px; }
    .tecz-md-pane { position: relative; height: 350px; }
}