html,
body {
    min-height: 100%;
}
body {
    background-color: #f6eee3;
}
.btn.pressed {
    background-color: var(--bs-primary);
    box-shadow: inset 2px 3px 6px rgba(0, 0, 0, 0.2), inset -3px -2px 6px rgba(255, 255, 255, 0.2);
    color: #fff;
}
#svgWrap {
    width: 100%;
    height: 100%;
}
#svgWrap > svg {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    cursor: crosshair;
}
#patterns {
    overflow-x: auto;
    overflow-y: hidden;
}
#patterns::-webkit-scrollbar,
#colors::-webkit-scrollbar {
    display: none;
}
#fillSample {
    grid-area: 1 / 1 / 3 / 2;
    padding: 1px;
    display: grid;
    grid-template: auto / auto;
    position: relative;
}
#fillSample > * {
    grid-area: 1 / 1 / 2 / 2;
}
#fillSample input[type="range"] {
    position: absolute;
    writing-mode: vertical-lr;
    direction: rtl;
    appearance: slider-vertical;
    width: 16px;
    bottom: 3px;
    right: 3px;
    left: auto;
    top: 25px;
}
#fillSample .title {
    text-align: center;
    margin-top: 3px;
    text-shadow: #fff 0 0 1px;
}
#fillSample .value {
    background-color: #333;
    color: #fff;
    border-radius: 4px;
    text-align: center;
    line-height: 30px;
    width: 40px;
    height: 30px;
    margin: 40px auto 0 auto;
}
#fillSample .svgBox {
    width: 86px;
    height: 110px;
}
#colors {
    overflow-y: hidden;
    overflow-x: auto;
    grid-area: 2 / 2 / 3 / 3;
    display: grid;
    grid-template: 1fr 1fr / 35px 16px 1fr;
}
#swapColors {
    grid-area: 1 / 2 / 3 / 3;
    margin-top: 0;
    margin-left: -1px;
    background: url(../images/double-arrow-v.png) 2px 0 no-repeat;
    background-size: 12px 100%;
    cursor: pointer;
}
#fgColors,
#bgColors {
    display: inline-flex;
}
#colorTheme {
    grid-area: 1 / 1 / 3 / 2;
}
#colorTheme button {
    transform-origin: 35px 35px;
    transform: rotate(-90deg);
    width: 70px !important;
    margin-left: 2px;
}
#patterns rect:hover {
    outline: 1px dashed #000;
}
#patterns rect.selected {
    outline: 1px solid #000;
}
.color {
    cursor: pointer;
    width: 34px;
    height: 34px;
    text-align: center;
    line-height: 34px;
    position: relative;
    border-radius: 5px;
    margin-right: 1px;
    margin-bottom: 1px;
}
.color.white {
    border: 1px solid rgba(0, 0, 0, 0.3);
}
.color:hover {
    border: 1px solid #000;
}
.color:hover:after {
    content: "";
    background: rgba(0, 0, 0, 0.25);
    position: absolute;
    top: 0;
    left: 0;
    width: 34px;
    height: 34px;
}
.patternSample {
    cursor: pointer;
}
.cross-cursor {
    pointer-events: none;
}
.panZoomControls {
    border-bottom: 1px solid #999;
}
#floater {
    position: fixed;
    top: calc(100vh - 150px - 1.5em);
    left: calc(100vw - 150px - 1.5em);
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    border: 1px solid #999;
    border-radius: 6px;
    z-index: 3;
    cursor: grab;
}
#floater .close {
    position: absolute;
    top: 2px;
    right: 2px;
    cursor: pointer;
}
.wait {
    display: none;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    --from: 80px;
    --to: 200px;
    --size: 32px;
    --time: 3s;
    --count: 51;
    --turns: 6;
    z-index: 99999;
}
.wait .msg {
    color: #fff;
    font-size: 2em;
    text-shadow: #000 0 0 5px;
    z-index: 1;
}
.circle {
    position: absolute;
    --delay: calc(var(--time) / var(--count) * -1 * var(--i));
    rotate: calc(var(--turns) * 1turn / var(--count) * var(--i));
    animation: circle var(--time) var(--delay) ease-in-out infinite;
}
.circle::before {
    content: "";
    display: block;
    width: var(--size);
    aspect-ratio: 1/1;
    border-radius: 50%;
    background-color: white;
    transform-origin: center center;
    animation: circleSize var(--time) var(--delay) ease-in-out infinite;
}
.rainbow .circle::before {
    background-color: hsl(calc(1turn / (var(--count) / var(--turns)) * var(--i)) 100% 70%);
}
@keyframes circle {
    from {
        transform: translate(0, var(--from));
    }
    to {
        transform: translate(0, var(--to));
    }
}
@keyframes circleSize {
    0%,
    100% {
        transform: scale(0);
    }
    25%,
    50% {
        transform: scale(1);
    }
}
.offcanvas-footer {
    padding: var(--bs-offcanvas-padding-y) var(--bs-offcanvas-padding-x);
    border-top: var(--bs-border-width) solid var(--bs-border-color);
}
.toolControls {
    --bs-border-color: #cfc9c4;
}
.toolControls fieldset {
    border: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color);
    padding: 1rem;
    padding-top: 0;
    border-radius: 255px 25px 225px 25px/25px 225px 25px 255px;
}
.toolControls fieldset legend {
    float: none;
    width: auto;
    font-size: 1rem;
    font-weight: 700;
    padding-right: 0.25rem;
    padding-left: 0.25rem;
    margin-bottom: 0.25rem;
}
.toolControls fieldset + fieldset {
    margin-top: 0.5rem;
}
.toolControls .shareIcons {
    font-size: 2em;
}
.toolControls .shareIcons .icon + .icon {
    margin-left: 0.5em;
}