.weather-lab{
  margin-top: 14px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 16px;
  padding: 16px;
  background: rgba(6, 12, 24, 0.66);
  box-shadow: 0 18px 60px rgba(0,0,0,0.28);
  backdrop-filter: blur(16px);
}

.weather-lab[hidden]{ display: none; }

.hero .actions .btn{
  min-width: 164px;
  justify-content: center;
  text-align: center;
}

.weather-lab-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.weather-lab h3{
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.weather-lab p{
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.weather-lab-close{
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.weather-lab-section{
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.045);
}

.weather-lab-section + .weather-lab-section{
  margin-top: 12px;
}

.weather-lab-section-title{
  margin-bottom: 10px;
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  font-weight: 700;
}

.weather-preset-grid{
  display: grid;
  grid-template-columns: repeat(6, minmax(74px, 1fr));
  gap: 8px;
}

.weather-preset-grid button,
.weather-lab-actions button{
  min-height: 36px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.045);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.weather-preset-grid button:hover,
.weather-preset-grid button.is-active{
  border-color: rgba(125,211,252,0.48);
  background: linear-gradient(135deg, rgba(125,211,252,0.2), rgba(167,139,250,0.14));
}

.weather-lab-control-grid{
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.weather-lab-control-grid > .weather-lab-section{
  margin-top: 0;
}

.weather-lab-controls{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.weather-lab-controls label{
  display: grid;
  gap: 6px;
  min-width: 0;
  color: rgba(255,255,255,0.82);
  font-size: 12.5px;
}

.weather-lab-controls input,
.weather-lab-controls select{
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  background: rgba(0,0,0,0.22);
  color: var(--text);
  padding: 6px 8px;
  accent-color: #7dd3fc;
}

.weather-lab-controls select option{ color: #111827; }

.weather-lab-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

body[data-weather="dust"]{ --bg: #3b2417; --wx-a: rgba(214,139,64,0.48); --wx-b: rgba(161,98,7,0.34); --wx-c: rgba(120,53,15,0.28); }
body[data-weather="tornado"]{ --bg: #09090b; --wx-a: rgba(75,85,99,0.48); --wx-b: rgba(127,92,48,0.28); --wx-c: rgba(15,23,42,0.38); }

@media (max-width: 980px){
  .weather-preset-grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .weather-lab-control-grid{ grid-template-columns: 1fr; }
}

@media (max-width: 720px){
  .hero .actions .btn{ flex: 1 1 168px; }
  .weather-preset-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weather-lab-controls{ grid-template-columns: 1fr; }
}

body.weather-console-page{
  --max: none;
  min-height: 100vh;
  overflow: hidden;
  background: #020617;
}

body.weather-console-page::before,
body.weather-console-page::after{
  display: none;
}

.weather-page-topbar{
  position: fixed;
  z-index: 5;
  top: 16px;
  left: 16px;
  right: 16px;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.48);
  box-shadow: 0 18px 60px rgba(0,0,0,0.28);
  backdrop-filter: blur(18px);
}

.weather-page-home,
.weather-page-tools .chip{
  white-space: nowrap;
}

.weather-page-title h1{
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.weather-page-title #weatherStatus{
  margin: 2px 0 0;
  max-width: 760px;
  color: rgba(255,255,255,0.72);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weather-page-tools{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.weather-page-tools .weather-controls{
  margin-top: 0;
}

.weather-page-tools .label{
  font-size: 12px;
}

.weather-page-stage-note{
  position: fixed;
  z-index: 4;
  right: 18px;
  bottom: 18px;
  width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.35);
  backdrop-filter: blur(14px);
  color: rgba(255,255,255,0.74);
  font-size: 13px;
}

.weather-page-stage-note strong{
  display: block;
  color: rgba(255,255,255,0.92);
  font-size: 14px;
  margin-bottom: 3px;
}

.weather-console-page .weather-lab{
  position: fixed;
  z-index: 4;
  left: 16px;
  top: 94px;
  bottom: 16px;
  width: min(420px, calc(100vw - 32px));
  margin-top: 0;
  overflow: auto;
  scrollbar-width: thin;
  background: rgba(6, 12, 24, 0.52);
  border-color: rgba(255,255,255,0.13);
}

.weather-console-page .weather-lab-head{
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(6,12,24,0.94), rgba(6,12,24,0.78));
  backdrop-filter: blur(14px);
}

.weather-console-page .weather-preset-grid{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.weather-console-page .weather-lab-control-grid,
.weather-console-page .weather-lab-controls{
  grid-template-columns: 1fr;
}

.weather-console-page .weather-lab-section{
  background: rgba(255,255,255,0.04);
}

@media (max-width: 980px){
  body.weather-console-page{
    overflow: auto;
  }

  .weather-page-topbar{
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .weather-page-tools{
    justify-content: flex-start;
  }

  .weather-page-title #weatherStatus{
    white-space: normal;
  }

  .weather-console-page .weather-lab{
    top: 170px;
    max-height: calc(100vh - 190px);
  }
}

@media (max-width: 640px){
  .weather-page-topbar{
    left: 10px;
    right: 10px;
    top: 10px;
  }

  .weather-page-tools,
  .weather-page-tools .weather-controls{
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .weather-console-page .weather-lab{
    left: 10px;
    right: 10px;
    top: 230px;
    bottom: 10px;
    width: auto;
  }

  .weather-page-stage-note{
    display: none;
  }
}

/* Compact standalone console: keep controls visible without burying the scene. */
.weather-console-page .weather-page-topbar{
  top: 12px;
  left: 12px;
  right: 12px;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
}

.weather-console-page .weather-page-title h1{
  font-size: 17px;
}

.weather-console-page .weather-page-title #weatherStatus{
  font-size: 12.5px;
}

.weather-console-page .weather-page-tools,
.weather-console-page .weather-page-tools .weather-controls{
  gap: 8px;
}

.weather-console-page .weather-page-tools .btn,
.weather-console-page .weather-page-tools .chip,
.weather-console-page .weather-select{
  min-height: 34px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.weather-console-page .weather-lab{
  left: 12px;
  top: 78px;
  bottom: 12px;
  width: min(560px, calc(100vw - 24px));
  padding: 12px;
  overflow: auto;
}

.weather-console-page .weather-lab-head{
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.weather-console-page .weather-lab-head p{
  display: none;
}

.weather-console-page .weather-lab-close{
  width: 30px;
  height: 30px;
  font-size: 20px;
}

.weather-console-page .weather-lab-section{
  padding: 10px;
  border-radius: 10px;
}

.weather-console-page .weather-lab-section + .weather-lab-section{
  margin-top: 0;
}

.weather-console-page .weather-lab-section-title{
  margin-bottom: 8px;
  font-size: 12px;
}

.weather-console-page .weather-preset-grid{
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.weather-console-page .weather-preset-grid button,
.weather-console-page .weather-lab-actions button{
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.2;
}

.weather-console-page .weather-lab-control-grid{
  margin-top: 10px;
  grid-template-columns: 1.08fr 1fr;
  gap: 8px;
  align-items: start;
}

.weather-console-page .weather-lab-control-grid > .weather-lab-section:nth-child(3){
  grid-column: 1 / -1;
}

.weather-console-page .weather-lab-controls{
  grid-template-columns: 1fr;
  gap: 8px;
}

.weather-console-page .weather-lab-control-grid > .weather-lab-section:nth-child(3) .weather-lab-controls{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.weather-console-page .weather-lab-controls label{
  gap: 4px;
  font-size: 12px;
  line-height: 1.35;
}

.weather-console-page .weather-lab-controls input,
.weather-console-page .weather-lab-controls select{
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 8px;
}

.weather-console-page .weather-lab-controls input[type="range"]{
  min-height: 20px;
  padding: 0;
}

.weather-console-page .weather-lab-actions{
  position: sticky;
  bottom: -12px;
  z-index: 3;
  margin-top: 10px;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(6,12,24,0), rgba(6,12,24,0.92) 34%);
}

.weather-console-page .weather-lab-actions .btn{
  flex: 1 1 160px;
}

@media (max-width: 980px){
  .weather-console-page .weather-lab{
    top: 158px;
    width: min(540px, calc(100vw - 24px));
    max-height: calc(100vh - 170px);
  }

  .weather-console-page .weather-preset-grid{
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .weather-console-page .weather-lab-control-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px){
  .weather-console-page .weather-lab{
    left: 10px;
    right: 10px;
    top: 220px;
    bottom: 10px;
    width: auto;
    max-height: calc(100vh - 230px);
  }

  .weather-console-page .weather-preset-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .weather-console-page .weather-lab-control-grid,
  .weather-console-page .weather-lab-control-grid > .weather-lab-section:nth-child(3) .weather-lab-controls{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px){
  .weather-console-page .weather-preset-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
