:root {
    --mp-accent: #10b981;
    --mp-navy: #1e2a4a;
    --mp-border: #d1d5db;
}

/* .ic-wrap box model (max-width/padding/margin) is owned centrally by
   dev-tool.css's ".dev-tool-widget .ic-wrap" rule — not redefined here
   to avoid the two paddings stacking and misaligning tool content. */

.ic-note {
    font-size: 13px;
    color: #6b7280;
    margin-top: 16px;
    line-height: 1.6;
}

/* ==== ACTION BAR ==== */
.ic-actionbar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.ic-btn {
    background: var(--mp-navy);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.ic-btn:hover {
    background: #16213e;
}

.ic-btn-outline {
    background: #fff;
    color: var(--mp-navy);
    border: 1px solid var(--mp-border);
}

.ic-btn-outline:hover {
    border-color: var(--mp-navy);
    background: #f9fafb;
}

.ic-btn-outline.mp-active {
    background: var(--mp-navy);
    color: #fff;
    border-color: var(--mp-navy);
}

/* ==== Two-panel layout, flush shared border ==== */
.mp-panels {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0;
    border: 1px solid var(--mp-border);
    border-radius: 10px;
    overflow: hidden;
}

.mp-panel {
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mp-panel:first-child {
    border-right: 1px solid var(--mp-border);
}

.mp-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f9fafb;
    border-bottom: 1px solid var(--mp-border);
    font-size: 13px;
    font-weight: 700;
    color: var(--mp-navy);
}

.mp-copy-btn {
    background: none;
    border: 1px solid var(--mp-border);
    color: var(--mp-navy);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.mp-copy-btn:hover {
    background: var(--mp-accent);
    border-color: var(--mp-accent);
    color: #fff;
}

.mp-copy-btn.mp-copied {
    background: var(--mp-accent);
    border-color: var(--mp-accent);
    color: #fff;
}

.mp-textarea {
    flex: 1;
    min-height: 420px;
    border: none;
    resize: vertical;
    padding: 14px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--mp-navy);
    background: #fff;
}

.mp-textarea:focus {
    outline: none;
}

.mp-textarea[readonly] {
    background: #f9fafb;
    color: #374151;
}

/* ==== Rendered preview body ==== */
.mp-preview-body {
    flex: 1;
    min-height: 420px;
    padding: 18px 20px;
    overflow: auto;
    font-size: 14.5px;
    line-height: 1.7;
    color: #1f2937;
}

.mp-preview-body h1,
.mp-preview-body h2,
.mp-preview-body h3,
.mp-preview-body h4,
.mp-preview-body h5,
.mp-preview-body h6 {
    color: var(--mp-navy);
    font-weight: 700;
    margin: 20px 0 10px;
    line-height: 1.3;
}

.mp-preview-body h1:first-child,
.mp-preview-body h2:first-child,
.mp-preview-body h3:first-child {
    margin-top: 0;
}

.mp-preview-body h1 { font-size: 26px; border-bottom: 1px solid var(--mp-border); padding-bottom: 8px; }
.mp-preview-body h2 { font-size: 21px; border-bottom: 1px solid var(--mp-border); padding-bottom: 6px; }
.mp-preview-body h3 { font-size: 18px; }
.mp-preview-body h4 { font-size: 16px; }
.mp-preview-body h5 { font-size: 14px; }
.mp-preview-body h6 { font-size: 13px; color: #6b7280; }

.mp-preview-body p {
    margin: 0 0 14px;
}

.mp-preview-body a {
    color: var(--mp-accent);
    text-decoration: underline;
}

.mp-preview-body strong {
    font-weight: 700;
}

.mp-preview-body em {
    font-style: italic;
}

.mp-preview-body del {
    text-decoration: line-through;
    color: #6b7280;
}

.mp-preview-body code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: #b91c1c;
}

.mp-preview-body pre {
    background: #1e2a4a;
    color: #e5e7eb;
    padding: 14px 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0 0 14px;
}

.mp-preview-body pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 13px;
}

.mp-preview-body blockquote {
    margin: 0 0 14px;
    padding: 4px 16px;
    border-left: 3px solid var(--mp-accent);
    background: #f9fafb;
    color: #4b5563;
}

.mp-preview-body ul,
.mp-preview-body ol {
    margin: 0 0 14px;
    padding-left: 26px;
}

.mp-preview-body li {
    margin-bottom: 6px;
}

.mp-preview-body img {
    max-width: 100%;
    border-radius: 6px;
}

.mp-preview-body hr {
    border: none;
    border-top: 1px solid var(--mp-border);
    margin: 20px 0;
}

.mp-preview-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 0 0 14px;
    font-size: 13.5px;
}

.mp-preview-body th,
.mp-preview-body td {
    border: 1px solid var(--mp-border);
    padding: 8px 12px;
    text-align: left;
}

.mp-preview-body th {
    background: #f9fafb;
    font-weight: 700;
    color: var(--mp-navy);
}

@media (max-width: 720px) {
    .mp-panels {
        grid-template-columns: 1fr;
    }

    .mp-panel:first-child {
        border-right: none;
        border-bottom: 1px solid var(--mp-border);
    }

    .mp-textarea,
    .mp-preview-body {
        min-height: 280px;
    }

    .ic-actionbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ic-actionbar .ic-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}
