.countryballWorkbench[hidden] {
    display: none !important;
}

body.countryballWorkbenchOpen {
    overflow: hidden;
}

.countryballWorkbench {
    z-index: 1000002;
}

.countryballWorkbenchDialog {
    width: min(1400px, 100%);
    height: min(940px, calc(100dvh - 36px));
    min-height: 560px;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.countryballWorkbenchHeader {
    align-items: center;
}

.countryballWorkbenchHeader > div {
    min-width: 0;
}

.countryballWorkbenchHeader h2,
.countryballWorkbenchHeader p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.countryballWorkbenchBody {
    display: grid;
    min-width: 0;
    min-height: 0;
    grid-template-columns: minmax(440px, 1fr) minmax(320px, 400px);
    gap: 12px;
    overflow: hidden;
    padding: 12px;
}

.countryballWorkbenchPreview {
    display: grid;
    min-width: 0;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 9px;
    padding: 10px;
}

.countryballWorkbenchPreviewHeader {
    display: flex;
    min-width: 0;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 10px;
}

.countryballWorkbenchPreviewHeader > span {
    min-width: 0;
}

.countryballWorkbenchPreviewHeader strong,
.countryballWorkbenchPreviewHeader span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.countryballWorkbenchPreviewHeader output {
    flex: 0 0 auto;
    max-width: 230px;
}

.countryballWorkbenchCanvasFrame {
    position: relative;
    width: auto;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    box-sizing: border-box;
    overflow: hidden;
    aspect-ratio: 1;
    place-self: center;
    min-width: 0;
    min-height: 0;
}

#countryballWorkbenchCanvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

#countryballWorkbenchStatus {
    min-height: 38px;
    white-space: normal;
}

.countryballWorkbenchMeta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    margin: 0;
}

.countryballWorkbenchMeta > div {
    display: block;
    min-width: 0;
    min-height: 42px;
}

.countryballWorkbenchMeta dt,
.countryballWorkbenchMeta dd {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.countryballWorkbenchMeta dd {
    margin: 4px 0 0;
}

.countryballWorkbenchControls {
    min-width: 0;
    min-height: 0;
    overflow: auto;
}

.countryballWorkbenchControls > .workflowSidebarHeader {
    flex: none;
}

.countryballWorkbenchControls .workflowStep {
    flex: none;
}

.countryballWorkbenchControls .workflowStepBody {
    display: block;
}

.countryballWorkbenchControls .workflowField {
    margin: 0;
}

.countryballWorkbenchControls .countryballFlagStepBody {
    display: grid;
    gap: 8px;
}

.countryballFlagGuidance {
    margin: 0;
    padding: 8px 10px;
    border: 1px solid rgba(87, 252, 252, 0.32);
    color: #c6d3cf;
    line-height: 1.55;
}

.countryballFlagUploadField {
    gap: 6px;
}

.countryballFlagUploadInput {
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 7px;
    border: 1px solid rgba(87, 252, 252, 0.38);
    background: #071011;
    color: #dce5e2;
    font: inherit;
}

.countryballFlagUploadInput::file-selector-button {
    min-height: 32px;
    margin: 0 9px 0 0;
    padding: 4px 12px;
    border: 1px solid rgba(87, 252, 252, 0.58);
    background: #111b1b;
    color: #f1f4f2;
    font: inherit;
    cursor: pointer;
}

.countryballFlagReadout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
}

.countryballFlagReadout > span {
    display: grid;
    min-width: 0;
    gap: 4px;
    padding: 7px 9px;
    border: 1px solid rgba(87, 252, 252, 0.22);
    color: #91a6a0;
}

.countryballFlagReadout output {
    overflow: hidden;
    color: #dce5e2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.countryballFlagWarning {
    min-height: 38px;
    white-space: normal;
}

.countryballFlagWarning[data-tone="warning"] {
    border-color: rgba(232, 190, 86, 0.62);
    color: #ebd69c;
}

.countryballFlagActions {
    display: grid;
    grid-template-columns: minmax(130px, auto) minmax(0, 1fr);
    gap: 6px;
}

.countryballFlagActions > button,
.countryballFlagActions > output {
    min-width: 0;
}

.countryballFlagActions > output {
    white-space: normal;
}

.countryballWorkbenchControls .countryballComponentSlots {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.countryballComponentSlots .workflowField {
    min-width: 0;
}

.countryballComponentSlots .workflowField > small {
    white-space: normal;
}

.countryballComponentNotice {
    grid-column: 1 / -1;
    min-height: 38px;
    white-space: normal;
}

.countryballComponentNotice[data-tone="warning"] {
    border-color: rgba(232, 190, 86, 0.62);
    color: #ebd69c;
}

.countryballWorkbenchNotice {
    flex: none;
    margin: 0;
}

.countryballWorkbenchNotice p {
    margin: 7px 0 0;
}

.countryballWorkbenchFooter {
    min-width: 0;
    margin: 0;
    padding: 10px 14px;
}

.countryballWorkbenchFooter > button {
    min-width: 0;
}

.countryballWorkbenchFooter > output {
    min-width: 0;
    justify-content: center;
    text-align: center;
}

.countryballWorkbenchFooter .workflowDownload {
    width: 100%;
    margin: 0;
}

@media (max-width: 920px) {
    .countryballWorkbenchDialog {
        height: calc(100dvh - 18px);
        min-height: 0;
    }

    .countryballWorkbenchBody {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(360px, 1fr) auto;
        overflow: auto;
    }

    .countryballWorkbenchControls {
        overflow: visible;
    }

}

@media (max-width: 620px) {
    .countryballWorkbench {
        padding: 0;
    }

    .countryballWorkbenchDialog {
        width: 100%;
        height: 100dvh;
    }

    .countryballWorkbenchBody {
        padding: 6px;
    }

    .countryballWorkbenchMeta {
        grid-template-columns: 1fr;
    }

    .countryballFlagReadout,
    .countryballFlagActions,
    .countryballWorkbenchControls .countryballComponentSlots {
        grid-template-columns: 1fr;
    }

    .countryballWorkbenchFooter {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}
