* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  /* Disable text selection */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

html {
  font-size: 100%;
  /* Disable touch zooming */
  touch-action: none;
  -ms-touch-action: none;
  height: 100%;
}

body {
  font-family: Arial, sans-serif;
  background-color: #fff;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh; /* Fallback */
  min-height: calc(var(--vh, 1vh) * 100); /* Adjusted viewport height */
  height: 100%;
  color: #333;
  overflow: hidden;
  /* Prevent overscroll/bounce effect */
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
}

.container {
  /* Use flex to fill available space */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%; /* Use all available height */
  width: 100%;
  max-width: 800px;
  padding: 3px;
}

.data-grid {
  display: flex;
  flex-direction: column;
  width: 95%;
  /* Use flex to distribute space */
  flex: 1;
  justify-content: space-evenly;
  align-items: center;
  /* Space between cards */
  padding: 0 10px;
}

.data-card {
  background-color: #e8f5e9;
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  border: 2px solid #a5d6a7;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
  width: 100%;
  height: 20vh; /* Fixed height based on viewport */
  display: flex;
  flex-direction: column;
  justify-content: center;
  aspect-ratio: 2.2 / 1; /* More square-like than before */
}

.data-card-2 {
  background-color: #e8f5e9;
  border-radius: 16px;
  padding: 1.5rem 1rem;
  text-align: center;
  border: 2px solid #a5d6a7;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
  width: 100%;
  height: 20vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  aspect-ratio: 2.2 / 1; /* More square-like than before */
}

.data-card-3 {
  /* background-color: #0073e6; */
 
  /* border-radius: 16px; */
  /* padding: 1.5rem 1rem; */
  /* text-align: center; */
  /* border: 2px solid #a5d6a7; */
  /* box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1); */
  /* transition: transform 0.2s ease; */
  /* width: 100%; */
  height: 7vh;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
}

.solar-data{
  display: flex;
}
.data-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}

.data-label {
  font-size: clamp(1.4rem, 4.8vw, 2rem);
  color: #333;
  margin-bottom: 10px;
  font-weight: 500;
}

.data-value {
  font-size: 2.8rem;
  font-weight: bold;
  color: #1b5e20;
}

button {
  background-color: #e8f5e9;
  color: #0073e6;
  border: none;
  font-size: clamp(26px, 5vw, 34px);
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  width: clamp(55px, 9vw, 65px);
  height: clamp(55px, 9vw, 65px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  touch-action: manipulation;
  min-width: 50px;
  min-height: 50px;
  margin: 0 3px;
}

button:active {
  transform: scale(0.95);
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: clamp(35px, 8vw, 55px);
  height: clamp(35px, 8vw, 55px);
  border: 5px solid rgba(27, 94, 32, 0.1);
  border-radius: 50%;
  border-top-color: #1b5e20;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Hide text when showing spinner */
.loading .data-value {
  display: none;
}

/* Responsive design for all viewport sizes */
@media (max-height: 600px) {
  .data-grid {
    gap: 8px;
  }

  .data-card,
  .data-card-2 {
    padding: 0.9rem;
    height: 22.5vh;
  }

  .data-label {
    margin-bottom: 5px;
  }

  button {
    min-width: 45px;
    min-height: 45px;
  }
}

@media (max-width: 380px) {
  html {
    font-size: 95%;
  }

  .data-card,
  .data-card-2 {
    border-radius: 14px;
  }

  .data-value {
    font-size: 2.5rem;
  }

  button {
    min-width: 45px;
    min-height: 45px;
  }
}

.meter-btn {
  right: 0.8rem;
  background: #0073e6;
  border: none;
  /* border-radius: 50%; */
  width: 100vw;
  height: 6rem;
  font-size: 1.4rem;
  line-height: 1;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); */
  z-index: 1200;
  bottom: 0.8rem;
  border-radius: 0%;
  
}


.overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(255, 255, 255);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.overlay.hidden {
  display: none;
}

.overlay h2 {
  margin: 0 0 1.5rem;
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  color: #0073e6;
}
.meter-row{
  display:flex;align-items:center;           /* stay on one line               */
  justify-content:space-between;
  width:min(95%,340px);
  padding:.5rem 1rem;
  border-bottom:1px solid #e0e0e0;
  background:#fafafa;                        /* subtle card behind each row     */
  border-radius:8px;                         /* rounded corners                 */
  margin:.35rem auto;
}
.meter-row .label {
  opacity: 0.7;
  font-weight: 500;
  font-size:clamp(1.6rem,5vw,2.2rem);     
}
.pos {
  color: #1b5e20;
}
.neg {
  color: #c62828;
}

.sub {
  margin-top: 1.8rem;
  font-size:clamp(1.5rem,5vw,2.4rem);
  color: #0073e6;
  text-align: center;

}
.part1{
width: 100vw;
margin-bottom: 2vh;
}

.part2{
  width: 100vw;
  margin-top: 2vh;
  margin-bottom: 1vh;
}
.meter-row + .sub {
  margin-top: 2.2rem;
} /* a bit more space above second heading */


.meter-row span:last-child{              
  font-size:clamp(2rem,8vw,3.4rem);      
  font-weight:700;
}


.lbl{
  font-size:clamp(1.2rem,4vw,1.5rem);
  color:#606060;                             /* muted grey                      */
  font-weight:600;
}

.val{
  font-size:clamp(1.8rem,6vw,2.2rem);        /* a touch smaller than before     */
  font-weight:700;letter-spacing:.5px;
  text-align:right;min-width:6.5ch;          /* keeps column rigid              */
}



/* colour cue already there – just attach to .val */
.val.pos{color:#11a71d}
.val.neg{color:#c62828}
