.jtab-colors-classic {
    --jtab-colors-background: white;
    --jtab-colors-lines: black;
    --jtab-colors-text: black;
    --jtab-colors-chorddot: black;
    --jtab-colors-chorddottext: white;
}

.jtab-colors-themed {
    --jtab-colors-background: var(--background-primary);
    --jtab-colors-lines: var(--text-normal);
    --jtab-colors-text: var(--text-normal);
    --jtab-colors-chorddot: var(--text-normal);
    --jtab-colors-chorddottext: var(--text-highlight);
}

.jtab > div[id^="builder_"] {
    /* Even out the right margin with the forced left margin of the svg */
    display: inline-block; padding-right: 15px;
    background: var(--jtab-colors-background);

    svg {
        /* jtab color scheme */
        background: none;
        path  { stroke: var(--jtab-colors-lines); fill: none; } 
        text  { stroke: none; fill: var(--jtab-colors-text); }
        circle {
            stroke: none; fill: var(--jtab-colors-chorddot);
            &+ text {stroke: none; fill: var(--jtab-colors-chorddottext); }
        }
    }
}

.jtab-settings-page {
    .jtab-about {
        [data-heading="Quick Start"] + table td:first-child {
            // Don't let codeblock names wrap on -
            white-space: nowrap;
        }
    }

    .setting-item-heading {
        margin-bottom: 0.5em;
        .setting-item-name {
            font-size: large;
        }
    }
    
    .jtab-settings-colors-details {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: center;
        margin-bottom: 1.25em;
        padding: 0.5em;
        border: 1px solid var(--background-modifier-border);
        background-color: var(--background-primary); // match theme background the Notes have

        .jtab-settings-colors-examples {
            display: flex;
            flex-direction: column;
            align-items:center;
            margin-right: 1.25em;
            background-color: var(--jtab-colors-background);
        }

        .jtab-settings-colors-fields {
            .setting-item {
                padding: 0.5em 0;
                * { 
                    font-size: small;
                }

                .setting-item-control {
                    input[type="text"] {
                        width: 100px;
                    }

                    input[type="color"] {
                        width: 32px;
                    }
                }
            }
        }
    }
}

.jtab-codeblock {
    .jtab-markdown {
        // Hack: MarkdownRenderer.renderMarkdown() doesn't render css-enhanced
        // markdown like the standard markdown on the page so I need to tighten
        // things up a bit.
        margin-bottom: 0.25em;
        &, * {
            margin-block: 0;
        }
        &, ul {
            display: grid;
        }
    }
}

.jtab-error {
    border: 2px solid rgba(255, 0, 0, 0.3);
    border-radius: 7px;
    padding: 0.5em;
    font-size: smaller;

    .jtab-error-title { 
        font-weight: bold;
    }
    .jtab-error-message {
        font-family: monospace;
    }

    .jtab-error-src {
        position: relative;
        font-family: monospace;
        pre {
            margin: 0; // Reading view puts unfortunate top/bottom margins on pre
        }

        .jtab-error-help {
            position: absolute;
            bottom: 2px;
            right: 5px;
            white-space: nowrap;

            a {
                font-size: smaller;
            }
        }
    }
}