:root {
	--bg-main: #f8fafc;
	--sidebar-bg: #ffffff;
	--text-dark: #1e293b;
	--text-muted: #64748b;
	--accent: #2563eb;
	--border-color: #e2e8f0;
	--input-bg: #f1f5f9;
	--danger: #ef4444;
}

.app-grid { display: grid; grid-template-columns: 320px 1fr; }

.sidebar1 { position: relative; padding-right: 1.5rem; display: flex; flex-direction: column; gap: 1.2rem; overflow-y: auto; }

.control-row { display: flex; flex-direction: column; gap: 6px; }
.label-box { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; font-weight: 600; }
.badge { border:1px solid var(--border-color); font-size:0.85rem;color: var(--text-dark);background: var(--input-bg); padding: 2px 8px; border-radius: 4px; }
input[type="range"] { width: 100%; accent-color: var(--accent); cursor: pointer; }
.color-row { display: grid; grid-template-columns: 45px 1fr; gap: 10px; }
input[type="color"] { width: 100%; height: 35px; border: 1px solid var(--border-color); border-radius: 4px; background: none; cursor: pointer; padding: 0; }

.section-divider { margin-top: 10px; border-top: 1px solid var(--border-color); padding-top: 15px; font-size: 0.85rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; }

.preview-pane { display: flex; flex-direction: column; align-items: center; overflow-y: auto; gap: 2rem; flex: 1; transition: background 0.2s; }
#main-box { border: 1px solid var(--bs-border-color);width: 200px; height: 200px; background: white; border-radius: 30px; flex-shrink: 0; margin:0;}

.layers-section { width: 100%; max-width: 850px; background: white; padding: 1.5rem; border-radius: 16px; border: 1px solid var(--border-color); }
.layer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.layer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 15px; }

.preview-container {
    flex-shrink: 0;
    margin-bottom: -1rem;
    padding:0;
}

.preview-stage {
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.shadow-tab { 
	width: 100px; height: 100px; border: 2px solid var(--border-color); border-radius: 12px; cursor: pointer; 
	position: relative; transition: 0.2s; display: flex; align-items: center; justify-content: center; background: #fff;
}
.shadow-tab.active { border-color: var(--accent); background: #f0f7ff; }
.tab-preview-sq { width: 35px; height: 35px; background: white; border-radius: 6px; pointer-events: none; border: 1px solid #e2e8f0 ; }
.btn-del { 
	position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; background: var(--danger); 
	color: white; border: none; border-radius: 50%; font-size: 14px; cursor: pointer; display: none; align-items: center; justify-content: center;
}
/*.shadow-tab:hover .btn-del { display: flex; }*/

.shadow-tab.active .btn-del {
    display: flex;
}

.template-grid { 
	display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; 
	margin-top: 10px; padding-top: 15px; border-top: 1px solid var(--border-color);
}
.temp-card { 
	padding: 10px; border: 1px solid var(--border-color); border-radius: 10px; cursor: pointer; 
	text-align: center; transition: 0.2s; background: var(--bg-main);
}
.temp-card:hover { border-color: var(--accent); background: #fff; transform: translateY(-2px); }
.temp-preview { width: 40px; height: 40px; background: white; margin: 0 auto 8px; border-radius: 8px; border: 1px solid #eee; }
.temp-name { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }

.btn-group { display: flex; gap: 8px; }
.btn-layer { font-size:0.85rem;background: var(--accent); color: white; border: none; padding: 3px 16px; border-radius: 8px; }
.btn-ghost { font-size:0.85rem;background: #f1f5f9; color: var(--text-dark); border: 1px solid var(--border-color); padding: 3px 16px; border-radius: 8px; }

.menu-btn { display: none; }

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 998;
}

.sidebar1 {
  z-index: 8;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.sidebar-close {
  position: absolute;
  top: 0px;
  right: 0px;
  padding: 4px 5px;
  border-radius: 4px;
  border: none;
  background: #d90036;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  display: none;

}

.sidebar-close:hover {
  background: #000;
}

.sidebar-close:hover {
  opacity: 1;
}

@media (max-width: 850px) {
	.sidebar-close {
		display: block;
	}
    .menu-btn {
        display: block;  z-index: 8;
        background: var(--accent); color: white; border: none; padding: 1px 15px;
        border-radius: 6px; cursor: pointer;
		font-size:0.85em;
    }

    .app-grid { grid-template-columns: 1fr; }

    .sidebar1 {
        position: fixed; top: 0; left: -320px;
        width: 320px; height: 100vh; z-index: 999; background:white;padding:20px;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 20px rgba(0,0,0,0.1);
    }

    .sidebar1.open {
        transform: translateX(320px);
    }

}

.box {
	height:100px;
	line-height:100px;
	text-align:center;
	margin:20px;
	border:1px solid #ccc;
	background:#f2f2f2;
}
.box-1 {
	box-shadow: 10px 0px 2px 0px rgba(128, 0, 0, 1);
}
.box-2 {
	box-shadow: -10px 0px 2px 0px rgba(128, 0, 0, 1);
}
.box-3 {
	box-shadow: 0px 10px 2px 0px rgba(128, 0, 0, 1);
}
.box-4 {
	box-shadow: 0px -10px 2px 0px rgba(128, 0, 0, 1);
}
.box-5 {
	box-shadow: 0px 0px 5px 0px rgba(128, 0, 0, 1);
}
.box-6 {
	box-shadow: 3px 3px 5px 0px rgba(128, 0, 0, 1);
}
.box-7 {
	box-shadow: 0px 0px 5px 5px rgba(128, 0, 0, 1);
}
.box-8 {
	box-shadow: 3px 3px 5px 5px rgba(128, 0, 0, 1);
}
.box-9 {
	box-shadow: 0px 0px 5px 5px #638253;
}
.box-10 {
	box-shadow: 3px 3px 5px 0px rgba(0, 128, 0, 1);
}
.box-11 {
	box-shadow: inset 0px 0px 5px 5px #638253;
}
.box-12 {
	box-shadow: inset 3px 3px 5px 0px rgba(0, 128, 0, 1);
}
.box-13 {
	box-shadow: 0 1px 4px rgba(0, 0, 0, .3),
		  -23px 0 20px -23px rgba(0, 0, 0, .8),
		  23px 0 20px -23px rgba(0, 0, 0, .8),
		  inset 0 0 40px rgba(0, 0, 0, .1);
}
.box-14 {
	box-shadow: 6px 6px #989898, 12px 12px #6c6666;
}
.box-15 {
   box-shadow: 0 0 0 1px #CCCCCC,
   0 -20px 0 -10px #00FFFF,
   20px 0 0 -10px #DC143C,
   0 20px 0 -10px #006400,
   -20px 0 0 -10px #FF00FF;
}
.box-16 {
  box-shadow: -15px -15px 2px -5px rgba(160,82,45,.5),
   -15px 15px 2px -5px rgba(0,255,255,.5),
   15px -15px 2px -5px rgba(255,0,0,.5),
   15px 15px 2px -5px rgba(255,255,0,.5);
}
.box-17 {
  box-shadow: 0 0 0 7px #60B88D,
   0 0 0 14px #90CDAF,
   0 0 0 21px #BFE3D1;
}
.box-18 {
  box-shadow:-20px 20px 0 -17px #fff,
   20px -20px 0 -17px #fff,
   20px 20px 0 -20px #c27153,
   0 0 0 2px #c27153;
}
dl {margin-left:30px;}