body {
    margin: 0;
    /* switch background color */
    background: #88a8b479;

    font-family: Helvetica, Arial, sans-serif;
    font-weight: normal;
    font-size: 20px;

    overflow: hidden;
}
canvas {
    position: absolute;
    top: 0;
    left: 0;
}

#canvasses {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 300px);
    height: 100%;
}
#canvasses[fullscreen="yes"] {
    width: 100%;
}
#canvasses[cursor="ink"] {
    cursor: url("cursors/ink.png") 0 30, auto;
}
#canvasses[cursor="drag"] {
    cursor: url("cursors/drag.png") 15 15, auto;
}
#canvasses[cursor="erase"] {
    cursor: url("cursors/erase.png") 5 25, auto;
}
#canvasses[cursor="label"] {
    cursor: url("cursors/label.png") 15 15, auto;
}
#canvasses[cursor="draw"] {
    cursor: url("cursors/draw.png") 15 15, auto;
}
body[sidebar-collapsed="yes"] #canvasses:not([fullscreen="yes"]) {
    width: calc(100% - 60px);
}

/**********
 PLAY CONTROLS
**********/

#playbar {
    position: absolute;
    bottom: 15px;
    left: calc(50% - 275px); /* 50% - half of (playbar width + sidebar width)*/

    width: 250px;
    height: 75px;

    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
#playbar[fullscreen="yes"] {
    left: calc(50% - 125px); /* 50% - half of (playbar width)*/
}
body[sidebar-collapsed="yes"] #playbar:not([fullscreen="yes"]) {
    left: calc(50% - 125px);
}
#playbar .component_button {
    position: absolute;
    bottom: 0;
    width: 230px;
    height: 25px;
    background: #444;
}
#playbar .component_button:hover {
    background: #555;
}
#playbar .play_slider {
    width: 190px;
    position: absolute;
    left: 30px;
    margin: 0;
}
.play_button_icon {
    width: 25px;
    height: 25px;
    background-image: url(icons/controls.png);
    display: inline-block;
    background-size: 400% 100%;
}
.play_button_icon[icon="0"] {
    background-position: 0 0;
}
.play_button_icon[icon="1"] {
    background-position: -25px 0;
}
.play_button_icon[icon="2"] {
    background-position: -50px 0;
}
.play_button_icon[icon="3"] {
    background-position: -75px 0;
}
.play_button_label {
    display: inline-block;
    position: relative;
    top: -5px;
}
div[big="yes"] .play_button_icon {
    width: 30px;
    height: 30px;
}
div[big="yes"] .play_button_label {
    top: -3px;
}

/**********
 TOOLBAR 
**********/

#toolbar {
    position: absolute;
    left: 0px;
    top: calc(33% - 142.5px); /* 33% - half of toolbar height */
    width: 75px;
    height: 280px;
    padding: 2px;
    background-color: rgba(135, 133, 133, 0.11);

    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
#toolbar[mode="play"] {
    display: none;
}

.toolbar_button {
    width: 60px;
    height: 60px;
    margin: 5px;
    border: 2px solid 99;
    cursor: pointer;
    background-size: 100% 100%;
}
.toolbar_button[selected="yes"] {
    border: 4px solid #463e4fff;
    background-color: #ddd;
}

/**********
 SIDEBAR 
**********/

#sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: #0b538718;
    font-weight: 100;
    font-size: 16px;

    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
#sidebar[collapsed="yes"] > div {
    margin: 8px;
}
#sidebar > .sidebar_toggle_container {
    margin: 25px;
}
#sidebar[collapsed="yes"] {
    width: 52px;
    min-width: 52px;
    background: rgba(11, 83, 135, 0.08);
}
#sidebar[collapsed="yes"] > div.sidebar_page {
    display: none !important;
}
#sidebar[collapsed="yes"] .sidebar_toggle_container {
    margin: 0 0 0 0;
    display: flex;
    justify-content: center;
}
.sidebar_toggle_container {
    position: relative;
    margin-bottom: 20px;
}
.sidebar_toggle_container .component_button {
    width: 100%;
    font-size: 16px;
    padding: 15px 5px;
    padding-right: 0px; /* avoid content being under the scrollbar */
    padding-left: 0px;
}
/* hidden sidebar elements custom */
#sidebar[collapsed="yes"] .sidebar_toggle_container .component_button {
    width: auto;
    font-size: 26px;
    padding: 25px 18px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}
#sidebar > div > div {
    margin-bottom: 15px;
}

#sidebar[mode="play"] {
    background: #222;
    color: #999999;
}
/* Make pages flexible and scrollable when content exceeds the available height.
   Uses a thin, minimal scrollbar that is visible only on overflow.
*/
#sidebar {
    display: flex;
    flex-direction: column;

}

#sidebar > .sidebar_page {
    flex: 1 1 auto;
    min-height: 0; /* allow flexbox children to shrink and scroll */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-right: 20px; /* avoid content being under the scrollbar */
    padding-left: 15px;
    margin: 2px; /* reduced margin for central frame per HITL */
}

/* Visual: minimal scrollbar for WebKit-based browsers */
#sidebar > .sidebar_page::-webkit-scrollbar {
    width: 7px;
}
#sidebar > .sidebar_page::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.18);
    border-radius: 6px;
}
#sidebar > .sidebar_page::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255,255,255,0.26);
}
#sidebar > .sidebar_page::-webkit-scrollbar-track {
    background: transparent;
}

/* Firefox thin scrollbar */
#sidebar > .sidebar_page {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.18) transparent;
    
}
#sidebar .mini_button {
    background: #999;
    color: #fff;
    border: 1px solid #0000aa99;
    padding: 5px 9px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}
#sidebar .mini_button:hover {
    background: #aaa;
}
#sidebar[mode="play"] .mini_button {
    background: #555;
    color: #fff;
}
#sidebar[mode="play"] .mini_button:hover {
    background: #666;
}
#sidebar a {
    color: #777;
}
#sidebar a:hover {
    color: #999;
}
#sidebar hr {
    border: none;
    border-bottom: 2px solid rgba(150, 150, 150, 0.5);
    width: 300px;
    position: relative;
    left: -25px;
    margin: 10px 0;
}
.container_color_swatch {
    position: absolute;
    top: -30px;
    left: 50%;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transform: translateX(-50%);
    pointer-events: none;
}
.container_members_info {
    font-size: 15px;
    color: #f4f4f4;
    background: rgba(0, 0, 0, 0.25);
    padding: 8px 10px;
    border-radius: 4px;
    transition: background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    white-space: pre-line;
}
.container_members_info[data-state="empty"] {
    opacity: 0.65;
}
.container_members_info[data-state="flash"] {
    animation: containerMembersFlash 0.6s ease;
    background: rgba(64, 146, 255, 0.32);
    box-shadow: 0 0 12px rgba(64, 146, 255, 0.45);
}
@keyframes containerMembersFlash {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}
.component_input {
    border: none;

    width: calc(100% - 10px);
    height: 22px;
    padding: 5px;

    font-size: 20px;
    font-weight: 100;
}
.component_textarea {
    border: none;
    width: calc(100% - 10px);
    height: 100px;
    padding: 5px;
    font-size: 16px;
    font-weight: 100;
}
.component_output {
    border: 1px solid #aaa;
    width: 100%;
    background: #ccc;
    color: #666;
    font-size: 15px;
    font-weight: 100;
}
.component_slider {
    position: relative;
    width: 250px;
    height: 52px;
}
.component_slider_graphic {
    position: absolute;
    width: 250px;
    height: 40px;
    cursor: pointer;
}
.component_slider_pointer {
    position: absolute;
    top: 42px;
    width: 15px;
    height: 10px;
}
.component_label {
    margin-bottom: 5px;
}
.component_button {
    width: calc(100% - 20px);
    background: #888;
    color: #fff;
    font-size: 20px;
    font-weight: 100;
    text-align: center;
    padding: 10px;
    border-radius: 5px;

    cursor: pointer;
}
.component_button:hover {
    background: #999;
}
.component_button[header="yes"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    background: #222;
    border-radius: 0px;
    color: #888;
}
.component_button[header="yes"]:hover {
    background: #333;
}

/**********

MODAL

**********/

#modal_container {
    display: none;
    position: absolute;
    width: 100%;
    height: 100%;

    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
#modal_container[show="yes"] {
    display: block;
}
#modal_bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}
#modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;

    width: 600px;
    height: 300px;
    padding: 10px;
    background: #dddfff;
}
#modal_close {
    width: 120px;
    font-weight: 100;
    color: #777;
    cursor: pointer;
}
#modal_close:hover {
    color: #ddd;
}
#modal_page {
    margin: 15px;
    font-size: 25px;
    font-weight: 100;
    color: #333;
}
#modal iframe {
    border: none;
}
