body {
	font-family: sans-serif;
	background: #f7f7f7;
	margin: auto;
	padding: 0 10px; /* add side padding for small screens */
	max-width: 100vw;
	box-sizing: border-box;
  }
  
  h1 {
	text-align: center;
	margin-bottom: 2rem;
	font-size: 1.8rem;
  }
  
  .calendar-month-block {
	background: white;
	border: 1px solid #ddd;
	border-radius: 8px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
	padding: 10px;
	margin: 0 auto 2.5rem auto;
	max-width: 100%; /* changed from 110vh to 100% for responsiveness */
	width: 100%;
	box-sizing: border-box;
  }
  
  .calendar-month-block h2 {
	text-align: center;
	margin-bottom: 1rem;
	font-size: 1.25rem;
  }
  
  .calendar-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 6px;
  }
  
  .weekday-header .day-box {
	font-weight: 600;
	background: #f0f0f0;
	text-align: center;
	border: none;
	padding: 3px 0;
	font-size: 0.75rem;
	color: #444;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
  }
  
  .day-box.weekday {
	min-height: 30px;    /* shorter height */
	padding: 4px 6px;    /* less vertical padding */
	font-weight: bold;
	text-align: center;
	background-color: #ddd;
  }
  
  .day-box {
	display: flex;
	flex-direction: row;
	align-items: flex-end;
	padding: 6px;
	min-height: 100px;
	border: 1px solid #ccc;
	background: white;
	position: relative;
	box-sizing: border-box;
	overflow: hidden; /* Prevent overflow */
	flex-wrap: wrap;  /* Allow bars to wrap to next line on small screens */
	gap: 2px;      
	  /* Small gap between bars */
  }
  
  .bar {
	width: 6px;   /* Remove right margin; gap used instead */
	cursor: pointer;
	flex-shrink: 1; /* Allow bars to shrink if needed */
	flex-grow: 0;   /* Don’t grow */
	flex-basis: 6px; /* Base width */
	transition: width 0.2s ease;
	margin-right: 3px; 
  }
  
  .day-box.empty {
	background: transparent;
	border: none;
  }
  
  .day-label {
	font-size: 0.85rem;
	font-weight: bold;
	color: #333;
	position: absolute;
	top: 6px;
	left: 8px;
	user-select: none;
  }
  
  .palika-legend {
	display: flex;
	justify-content: center;
	font-family: sans-serif;
	font-size: 14px;
	padding: 10px 0;
	border-bottom: 1px solid #ccc;
	margin: 0 auto;
	flex-wrap: wrap;  /* wrap legend items on small screens */
	gap: 10px;        /* spacing between legend items */
  }
  
  .calendar-header {
	display: flex;
	justify-content: center;
	font-size: 20px;
	padding: 10px 0;
	border-bottom: 1px solid #ccc;
	margin: 0 auto;
  }
  
  /* Responsive tweaks */
  @media (max-width: 768px) {
	.calendar-grid {
	  gap: 4px;
	}
	.day-box {
	  min-height: 80px;
	  gap: 1.5px;
	}
	.day-label {
	  font-size: 0.75rem;
	  top: 4px;
	  left: 6px;
	}
	.bar {
	  width: 3px;
	  margin-right: 2px;
	}
	.calendar-month-block h2 {
	  font-size: 1.1rem;
	}
  }
  
  @media (max-width: 480px) {
	.calendar-grid {
	  grid-template-columns: repeat(7, minmax(20px, 1fr));
	  gap: 3px;
	}
	.day-box {
	  min-height: 60px;
	  padding: 2px 4px;
	  gap: 1.5px;
	}
	.day-label {
	  font-size: 0.7rem;
	  top: 3px;
	  left: 4px;
	}
	.bar {
		width: 3px;
		flex-basis: 4px;
		margin-right:2px ;
	  }
	.calendar-month-block h2 {
	  font-size: 1rem;
	}
	body {
	  padding: 0 5px;
	}
  }
  