  html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #f8fafc;
    font-family: sans-serif;
    overflow-x: hidden;   
	overflow-y: auto; 
  }

  #canvasWrapper {
    position: relative;
    width: 95vmin;
    height: 95vmin;
    margin: 10px auto 20px auto;
	margin-bottom: 20px;
	overflow: hidden; 
	border: 1px solid #ccc;
  }

  #drawCanvas,
  #guideCanvas,
  #previewCanvas {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
  }

  #guideCanvas {
    z-index: 0;
    pointer-events: none;
    background: #ffffff;
  }

  #drawCanvas {
    z-index: 1;
    touch-action: none;
    background: transparent;
   
  }

  #previewCanvas {
    z-index: 2;
    pointer-events: none;
  }

  /* Controls Container */
  #controls {
    position: fixed;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    justify-content: center;
    align-items: flex-start;
  }

  /* Tool Groups */
  .tool-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }

  .tool-group-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
  }

  .tool-group-vertical {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: 100%;
  }

  /* Buttons */
  .tool-btn,
  .color-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .tool-btn.active {
    background: #c80000;
    color: white;
    box-shadow: 0 0 0 2px #c80000 inset;
  }

  .tool-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
  }
	#toggleToolbar {
	 order: -1;
	  position: fixed;
	  top: 10px;
	  right: 10px;
	  z-index: 999;
	  background: #f1f5f9;
	  border: none;
	  border-radius: 50%;
	  width: 44px;
	  height: 44px;
	  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
	  display: flex;
	  align-items: center;
	  justify-content: center;
	  cursor: pointer;
	  transition: transform 0.3s ease;
	}  
	
	#controls.collapsed .tool-btn:not(#toggleToolbar) {
	  display: none !important;
	}	

  /* Color Picker */
  #colorPickerWrapper {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    border: 2px solid #ccc;
  }

  #colorPicker {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
  }

  #currentColor {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #c80000;
  }

  /* Brush Slider */
  .slider-container {
    position: relative;
    display: inline-block;
  }

  #brushSlider,
  #brushPreview {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
  }

  #brushSlider {
    left: 50px;
    width: 100px;
    transform-origin: left;
    transform: translateY(-50%) scaleX(0);
  }

  #brushPreview {
    left: 160px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #c80000;
    border: 1px solid #444;
    transform: translateY(-50%) scale(0);
  }

  .slider-container.active #brushSlider,
  .slider-container.active #brushPreview {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    pointer-events: auto;
  }

  /* Ad Container */
	#adContainer {
	  margin: 20px auto;
	  text-align: center;
	  min-height: 100px;
	  max-width: 100vw;
	  padding-bottom: 10px;
	}

  /* ========== Media Queries ========== */

  /* Mobile Layout */
  @media (max-width: 767px) {
    #controls {
      bottom: 10px;
      left: 50%;
      transform: translateX(-50%);
      flex-direction: row;
      flex-wrap: wrap;
      justify-content: center;
      width: calc(100% - 20px);
      max-width: 95vw;
    }

    .tool-group {
      flex-direction: row;
    }

    .tool-group-vertical {
      max-width: 95vw;
    }
  }

  /* Extra Small Devices */
  @media (max-width: 480px) {
    .tool-btn {
      width: 40px;
      height: 40px;
    }

    .tool-btn svg {
      width: 18px;
      height: 18px;
    }
  }

  /* Desktop (Sidebar) Layout */
  @media (min-width: 768px) {
    #controls {
      top: 10px;
      left: 10px;
      flex-direction: column;
      max-width: 100px;
    }

    .tool-group,
    .tool-group-row {
      flex-direction: column;
    }
  }
	/* Fill indicator*/
	
	#fillIndicator {
		  position: fixed;
		  top: 10px;
		  left: 50%;
		  transform: translateX(-50%);
		  background: black;
		  color: white;
		  padding: 10px 16px;
		  font-size: 16px;
		  z-index: 999999 !important;
		  border-radius: 8px;
		  opacity: 1;
		  visibility: visible;
		  pointer-events: none;
		}

	#fillIndicator.hidden {
	  opacity: 0;
	  visibility: hidden;
	}

	#fillIndicator.show {
	  opacity: 1;
	  visibility: visible;
	}
	
	/* ZOOM */	

	#zoomControls {
	  position: fixed;
	  bottom: 12px;
	  right: 12px;
	  display: flex;
	  flex-direction: column;
	  gap: 12px;
	  background: rgba(255, 255, 255, 0.85);
	  padding: 8px;
	  border-radius: 12px;
	  box-shadow: 0 0 8px rgba(0,0,0,0.2);
	  z-index: 1000;
	}
	#zoomControls i {
	  width: 32px;
	  height: 32px;
	  cursor: pointer;
	  color: #333;
	  touch-action: manipulation;
	}