﻿wa-page {
    --menu-width: 15rem;
    --aside-width: auto;
}

    wa-page[view='mobile'] {
        --menu-width: auto;
        --aside-width: auto;
    }

main {
    max-inline-size: 100%;
    margin-inline: auto;
    padding: 0;
}

.grid-2x2 {
    display: grid;
    grid-template-columns: 50% 50%;
    grid-template-rows: auto 1fr;
    row-gap: var(--wa-space-s);
}

.toolbar {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--wa-color-surface-raised);
    border-bottom: 1px solid var(--wa-color-neutral-border);
}

wa-textarea.code-editor::part(textarea) {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 14px;
    line-height: 1.5;
    tab-size: 2;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

wa-textarea.code-editor {
    --padding: 0.75rem;
}

/* the right-hand column: the output, and the drawing below it */
.output-column {
    display: flex;
    flex-direction: column;
    gap: var(--wa-space-s);
    padding: var(--wa-space-xs);
    min-height: 0;
}

.output-list {
    flex: 1 1 40%;
    min-height: 8rem;
}

.drawing-panel {
    flex: 1 1 60%;
    display: flex;
    flex-direction: column;
    min-height: 16rem;
    border: 1px solid var(--wa-color-neutral-border);
    border-radius: var(--wa-border-radius-m);
    overflow: hidden;
}

.drawing-toolbar {
    align-items: center;
    justify-content: space-between;
}

/* the picture fills the panel below its toolbar and never spills out of it; the server draws it on this background
   (the theme's), in colours that show on it */
.drawing-view {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 14rem;
    overflow: hidden;
    padding: var(--wa-space-s);
    background: var(--wa-color-surface-default);
    color: var(--wa-color-text-quiet);
}

.drawing-view img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: var(--wa-space-s);
    object-fit: contain;
}

.drawing-view img[hidden] {
    display: none;
}
