body {
    font-family: sans-serif;
    touch-action: manipulation;
}

.flex-row {
    display: flex;
    flex: 0 0 auto;
}

zwibbler {
    touch-action: none;
}

zwibbler button {
    -webkit-appearance: none;
    /* Fix buttons on ios safari */
}

.noselect {
    user-select: none;
    -webkit-user-select: none;
}

.wrap {
    flex-wrap: wrap;
}

.flex-col {
    display: flex;
    flex-flow: column;
}

.stretch {
    flex: 1 1 auto;
}

.full {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
}

.toolbar {
    background: #eee;
}

.toolbar button {
    border: none;
    border-radius: 5px;
    background: #ccc;
    margin: 5px;
    border: 3px solid transparent;
    width: 50px;
    height: 50px;
    padding: 0;
    flex: 0 0 auto;
}

.toolbar button i {
    font-size: 40px;
}

.toolbar button img {
    width: 46px;
}

.toolbar button.selected {
    border: 3px solid navy;
}

.toolbar button[disabled] {
    opacity: 0.5;
}

.show-toolbar {
    display: none;
}

.hide-toolbar {
    display: initial;
}

.expanded [z-canvas],
.expanded .expander {
    display: none;
}


/* PARAMETER: Width/height are the size of the images in the image selector when it does not take the
   entire screen. */
.image-picker img {
    max-width: 80px;
    max-height: 80px;
    margin: 10px;
    align-self: center;
}

/* PARAMETER: Width/height are the size of the images in the image selector when it takes the entire screen
   entire screen. */
.expanded .image-picker img {
    max-width: 120px;
    max-height: 120px;
}

/* PARAMETER: Size of the numbers in the image category buttons.*/
.image-picker button {
    font-size: 16px;
}

.sidebar {
    max-width: 302px;
}

.expanded .sidebar {
    max-width: none;
    flex: 1 1 auto;
}

zwibbler {
    user-select: none;
    -webkit-user-select: none;
}

.tools button {
    border: 0;
    background: transparent;
    padding: 10px;

    /** PARAMETER: The size of the undo, redo buttons. */
    font-size: 15px;
}

/** May 14, 2021 */
/** PARAMETER: The size of the paint tool buttons. */
.tools button img {
    height: 30px;
}

.context-menu .tools button i {
    font-size: 30px;
}


.tools button.disabled {
    opacity: 0.5;
}

.tools button:hover {
    background: #ccc;
}

.expander,
.reducer {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    width: 30px;
    font-size: 20px;
    justify-content: center;
    background: rgb(141, 120, 120);
    cursor: pointer;
    flex: 0 0 auto;
}

.context-menu {
    border-radius: 3px;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    font-family: sans;
    font-size: 20px;
    background: white;
    cursor: pointer;
    /* July 8, 2021: Add this line */
    max-width: 100vw;
}

.context-menu>div {
    padding: 10px;
}

.context-menu i {
    margin-right: 10px;
}

.context-menu>div:not(.tools):hover {
    background: #337AB7;
}

.context-menu img {
    height: 20px;
    margin-right: 10px;
    vertical-align: middle;
}

.context-menu button i {
    margin-right: 0;
}

.context-menu .tools button {
    margin: 10px;
}

.image-picker button {
    border: 0;
    background: transparent;
    padding: 10px;
    border-bottom: 3px solid transparent;
}

.image-picker button.selected {
    border-bottom: 3px solid #ccc;
}

.tools {
    border: 3px solid #ccc;
    border-radius: 30px;
    margin: 10px;
    box-sizing: border-box;
    flex-flow: row wrap;
    max-width: 95%;
}

.show-menu {
    position: absolute;
    left: 10px;
    top: 10px;
    padding: 5px;
}

.mobile-only {
    display: none;
}

@media only screen and (max-width: 1000px) {
    .mobile-only {
        display: initial;
    }

    .desktop {
        display: none;
    }

    .desktop-only {
        display: none;
    }

    [z-popup="main-menu"] {
        display: flex;
        flex-flow: row wrap;
    }

}

.expanded .desktop {
    display: initial;
}

.pages {
    display: flex;
    flex: 0 0 auto;
    flex-flow: row wrap;
}

.page {
    border: 1px solid #ccc;
    box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.5);
    margin: 5px;
    flex: 0 0 auto;
    align-self: flex-start;
}

.page.selected {
    outline: 2px solid #5288e3;
}

.pages button {
    padding: 10px;
    border: 2px solid transparent;
    background: transparent;
    border-radius: 5px;
}

.pages button:hover {
    border: 2px solid #5288e3;
}

.backgrounds {
    display: flex;
    flex: 0 0 auto;
    flex-flow: row wrap;
}

.backgrounds img {
    max-width: 30px;
    max-height: 30px;
    margin: 10px;
    border: 1px solid #ccc;
}

input[type="text"] {
    font-size: 16px;
}

/** May 14, 2021 */
[z-popup="info-popup"] {
    background: white;
    border-radius: 10px;
    border: 2px solid #ccc;
    padding: 10px;
    max-width: 90%;
    width: 500px;
    text-align: center;
    font-family: sans-serif;
    box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.2);
}

[z-popup="dot-controls-popup"] {
    height: 40px;
    padding: 10px;
    background: #eee;
    display: flex;
    flex-flow: row wrap;
}

.dot-controls {
    position: absolute;
    bottom: 0;
    right: 0;
    /* block out presses near the arrows from affecting the main canvas */
    padding-top: 50px;
    padding-left: 50px;
}

.rotate-90 {
    transform: rotate(90deg);
}

.rotate-180 {
    transform: rotate(180deg);
}

.rotate-270 {
    transform: rotate(270deg);
}

.dot-controls {
    touch-action: none;
}


.dot-controls img {
    width: 30px;
}

.dot-controls td {
    text-align: center;
}

.dot-controls button {
    -webkit-appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    padding: 2px;
    touch-action: none;
    font-size: 0;
    /* Fix mandatory padding on ios safari */
}

.dot-controls button i {
    font-size: 30px;
}

.close-dot-tool-button {
    position: absolute;
    top: 10px;
    right: 10px;
}

.close-dot-tool-button img {
    width: 20px;
}

.mobile-notes-button {
    position: absolute;
    top: 0;
    right: 0;
    /* block out presses near the button from affecting the main canvas */
    padding: 20px;
    touch-action: none;
}