	
	
	
	@font-face {
    font-family: 'largedigit';    
    src: url('fonts/digital-7.woff') format('woff'),
         url('fonts/digital-7.ttf')  format('truetype');
    font-weight: 400;
    font-style: normal;
  }
  
	@font-face {
    font-family: 'largedigit';    
    src: url('fonts/digital-7.mono.woff') format('woff'),
         url('fonts/digital-7 (mono).ttf')  format('truetype');
    unicode-range: u+30-39; /*numers are monospaced*/
    font-weight: 400;
    font-style: normal;
  }
  
  @font-face {
    font-family: 'Boomer Tantrum';
    font-style: normal;
    font-weight: normal;
    src: local('Boomer Tantrum Regular'), url('fonts/Boomer Tantrum.woff') format('woff');
  }
  
  @font-face {
    font-family: 'RussoOne';
    font-style: normal;
    font-weight: normal;
    src: local('RussoOne Regular'), url('fonts/RussoOne-Regular.ttf') format('truetype');
  }

.maincontainer{
	max-width:800px;
	width:90%;
	margin: auto;
	position: relative;
}

/* ── Dashboard icon bar (top-right of maincontainer) ─────── */
.dash-icon-bar {
  position: absolute;
  right: 0;
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 50;
}
.dash-icon {
  width: 20px;
  height: 20px;
  display: block;
  cursor: pointer;
}

/* ── Dashboard popup tooltip ─────────────────────────────── */
.dash-popup {
  display: none;
  position: absolute;
  top: 30px;
  right: 0;
  background: #050f18;
  border: 1px solid #1a3a4a;
  border-radius: 4px;
  padding: 7px 12px;
  font-family: 'RussoOne', sans-serif;
  font-size: 0.62em;
  letter-spacing: .06rem;
  color: #5a9ab8;
  white-space: nowrap;
  z-index: 200;
}
.dash-popup.visible { display: block; }

/* Warning triangle — off: black fill, lightblue outline */
#icon-warn .icon-poly     { fill: #000; stroke: lightblue; stroke-width: 1.5; stroke-linejoin: round; }
#icon-warn .icon-exclaim  { fill: lightblue; font-family: Arial, sans-serif; font-weight: bold; }
/* Warning triangle — on: red */
#icon-warn.warn-active .icon-poly    { fill: #cc0000; stroke: #ff4444; }
#icon-warn.warn-active .icon-exclaim { fill: #fff; }

/* Cog — dimmed (external) */
#icon-cog .icon-path { fill: #1a2a3a; }
/* Cog — active (internal / linked) */
#icon-cog.cog-active .icon-path { fill: lightblue; }

.wind {
  background-color: black; /*#2196F3;*/
  padding: 5px;
  float: left;
  width: 38%; /* The width is 20%, by default */
  cursor: pointer;
  touch-action: manipulation;
}

.rain {
  background-color: black; /*#f1f1f1;*/
  padding: 5px;
  float: left;
  width: 26%; /* The width is 60%, by default */
  cursor: pointer;
  touch-action: manipulation;
}

.sun {
  background-color: black; /*#04AA6D;*/
  padding: 5px;
  float: left;
  width: 25%; /* The width is 20%, by default */
}

.uv {
  background-color: black; /*#04BA6D;*/
  padding: 5px;
  float: left;
  width: 11%; /* The width is 20%, by default */
}

.outdoorCircle {
  background-color: black;
  padding: 5px;
  float: left;
  width: 25%; /* The width is 25%, by default */
  height:250px; /*50mm*5 */
}

.directionCircle {
  background-color: black;
  padding: 5px;
  float: left;
  width: 25%; /* The width is 25%, by default */
  height:250px; /*50mm*5 */
}

.drewpointCricle {
  background-color: black;
  padding: 5px;
  float: left;
  width: 25%; /* The width is 25%, by default */
  height:250px; /*50mm*5 */
}

.sensorCircle {
  background-color: black;
  padding: 5px;
  float: left;
  width: 25%; /* The width is 25%, by default */
  height:250px; /*50mm*5 */
}


.f1 {		
  font-family: 'Boomer Tantrum', sans-serif;
  font-size: 0.7em; /* 40px/16=2.5em */
  letter-spacing: .2rem;
}

.f2 {		
  font-family: 'Boomer Tantrum', sans-serif;  
  font-size: 0.7em; /* 40px/16=2.5em */
  letter-spacing: .2rem;
}
.f2smal {		
  font-family: 'Boomer Tantrum', sans-serif;  
  font-size: 0.5em; /* 40px/16=2.5em */
  letter-spacing: .2rem;
}

.f3 {		/*Digital only Numbers are mono spaced */
  font-family:'largedigit';
	font-size: 5em; /* 40px/16=2.5em */
  letter-spacing: -0.1rem;
  line-height: 60px;  
}
.f3smal {		/*Digital only Numbers are mono spaced */
  font-family:'largedigit';
	font-size: 3em; /* 40px/16=2.5em */
  letter-spacing: -0.1rem;
  line-height: 60px;  
}
.f3xsmal {		/*Digital only Numbers are mono spaced */
  font-family:'largedigit';
	font-size: 2em; /* 40px/16=2.5em */
  letter-spacing: -0.1rem; 
}
.f4 {		/*Units */
  font-family:'RussoOne';
	font-size:  1.0em; /* 40px/16=2.5em */  
  letter-spacing: .02rem;
}
.f4medium {		/*Units */
  font-family:'RussoOne';
	font-size:  0.7em; /* 40px/16=2.5em */  
  letter-spacing: .02rem;    
}
.f4smal {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.55em; /* 40px/16=2.5em */
  letter-spacing: .2rem;
  white-space: nowrap;
}


sup {
    vertical-align: super;
    font-size: smaller;
}

.windhead{
	width:100%; 	
	text-indent: 8em;
	color: gray;
	line-height: 5px;
}

.windsub{
	width:50%;
	text-indent: .3em; 
	float: left;
	text-align: left;
	color:yellow;
	height: 84px;  
}
.windsubnumber{
	/*text-indent: 0.3em;*/
	text-align: right;
	margin-right: 50px;
	}

.rainhead{
	width:100%; 		
	color: gray;
	line-height: 5px;
}
.rainlabel{
	text-indent: 4em;
	height:24px;
	}
	
.rainsub{	
	text-indent: .3em; 
	float: right;
	text-align: left;
	color:blue;
}
.rainsubnumber{
	display: inline-block; 
	vertical-align: top;
	}

.rainsubunit{
	display: inline-block; 
  margin-top:25px;
  text-indent: -0.3em;
	}

.sunhead{
	width:100%; 		
	color: gray;
	line-height: 5px;
}
.sunlabel{
	text-indent: 10em;
	height: 24px;
	}
	
.sunsub{	
	/*text-indent: .3em; */
	float: left;
	text-align: left;
	color:lightblue;
}
.sunsubnumber{
  display: inline-block;
  vertical-align: top;
  margin-right: -2px;
  margin-left: -4px;
  /*width: 100%;*/
  text-align: right;
}

.sunsubunit{
	display: inline-block; 
	vertical-align: top;	
}

.uvhead{
	width:100%; 		
	color: gray;
	line-height: 5px;
}
.uvlabel{
	text-indent: 10em;
  height: 24px;
}

.uvsub{	
	text-indent: .3em; 	
	text-align: right;
	color:lightblue;
}	
.uvsubnumber{
	width:auto; 
	vertical-align: top;
	margin-right: 10px;
	}
	
.tight{	
 padding: 0px; 
 white-space: nowrap;
}

.ocdiv{
	/* Dimensions and margin-top are set dynamically by sizeGauges() in WeatherStation.js */
	margin-top:25px;
	width:170px;
	height:170px;
}

.ochead{
	color: IndianRed;	
	text-align: center;	
}
.ocunit{
	/*margin-top:-7px;*/
	color: IndianRed;
	text-align: right;
	margin-right:27px;	
}
.ocvalue{
	color: IndianRed;	
	text-align: right;
	margin-right:15px;	
}

.ocdewsub{
	color:blue;
	white-space: nowrap;
}	
.ocdewvalue{	
	display: inline-block; 
	vertical-align: top;
	margin-top: 169px;	
	margin-left: 50px;
}
.ocdewunit{
	display: inline-block;     
	vertical-align: top;
  margin-top: 190px;	
   text-indent: -0.3em;
}

.occh{
	color: IndianRed;	
	display: inline-block;     	
	vertical-align: middle;		
}
.occhtext{
	text-align: right;
	display: inline-block;     	
	vertical-align: middle;	
	margin-left:46px;
}

.dircvalue{
	color: #026C3D;	
	width:170px;
	height:170px;
	text-align: center;
	vertical-align: middle;
	line-height: 170px; 
}

.dircsub{
	width:50%;
	text-indent: .3em; 
	float: left;
	text-align: left;
	color:#026C3D;	
	margin-top:180px;
}

.dircsubdata{
  white-space: nowrap;
}

.dircsubNumbers{
	/*text-indent: 1.0em;*/
	display: inline-block;
	vertical-align: top;
}
.dircsubUnit{	
	display: inline-block;
	vertical-align: top;
	margin-top: 10px;
	margin-left: -6px;
	
}

/*Dew Point */
.drchead{
	color: lightblue;
	text-align: center;	
}

.drcunit{
	/*margin-top:5px;*/
	color: lightblue;
	text-align: right;
	margin-right:27px;	
}

.drcvalue{
	color: lightblue;
	text-align: right;
	margin-right:15px;	
}

.drcpreshead{
	width:100%; 	
	/*text-indent: 8em;*/	
	text-align: left;	
}
.drcpresheadline{	
	display: inline-block; 
	vertical-align: top;
	margin-top: 179px;		
	color: gray;
}
.drcpresheadunit{
	display: inline-block;     
	vertical-align: top;
  margin-top: 179px;	
  color: lightblue;  
}
.drcpres{
	width:100%; 	
	/*text-indent: 8em;*/	
	text-align: center;	
	color: lightblue;
  white-space: nowrap;
}
.drcpresvalue{	
	display: inline-block; 
	vertical-align: top;
	
}
.drcpresunit{
	display: inline-block;     
	vertical-align: top;  
	margin-top: 28px;
}
.drch{
	color: lightblue;	
	display: inline-block;     	
	vertical-align: middle;		
}
.drchtext{
	text-align: right;
	display: inline-block;     	
	vertical-align: middle;	
	margin-left:46px;
}


.buttomlineDateTime {
	border-top: 1px solid #888;
  background-color: black; /*#2196F3;*/
  padding: 5px;
  float: left;
  width: 31%; /* The width is 20%, by default */
  min-height: 100px;
  height: auto;
}
.buttomlineIn {
	border-top: 1px solid #888;
  background-color: black; /*#2196F3;*/
  padding: 5px;
  float: left;
  width: 31%; /* The width is 20%, by default */
  min-height: 100px;
  height: auto;
}
.buttomlineWeatherPicto {
	border-top: 1px solid #888;
  background-color: black; /*#2196F3;*/
  padding: 4px;
  float: left;
  width: 20%; /* The width is 20%, by default */
  min-height: 100px;
  height: auto;
}
.buttomlineMoon {
	border-top: 1px solid #888;
  background-color: black; /*#2196F3;*/
  padding: 4px;
  float: left;
  width: 18%; /* The width is 18%, by default */
  min-height: 100px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bldthead{
	width:100%; 	
	/*text-indent: 8em;*/	
	text-align: left;	
}
.bldtheadline{	
	display: inline-block; 
	vertical-align: top;			
	color: gray;
}
.bldtunit{
	display: inline-block;     
	vertical-align: top;  
  color: lightblue;  
}
.bldtunit1{
	/*display: inline-block;     */
	vertical-align: top;  
  color: lightblue;  
  /*margin-left:77px;*/
  text-align: right;
  float: right;
}
.bldtclock{
	width:100%; 	
	/*text-indent: 8em;*/	
  display: flex;
	text-align: left;	
	color: lightblue;
}
.bldtclockHHMI{	
	display: inline-block; 
}
.bldtclockSS{
	display: contents;    
	line-height: 0.95;
	text-align: right;	 	
}
.bldtclockDDMM{
	/*display: inline-block;     */
	vertical-align: top;
	line-height: 0.95;
	text-align: right;
  float: right;
}
.dash-version {
  position: absolute;
  left: 6px;
  font-family: 'RussoOne', sans-serif;
  font-size: 0.55em;
  letter-spacing: .08rem;
  color: #3a6a7a;
  pointer-events: none;
}

.blinhead{	
	width:100%; 	
	/*text-indent: 8em;*/	
	text-align: left;	
}
.blinheadline{	
	display: inline-block; 
	vertical-align: top;			
	color: gray;
}
.blinunit{
	display: inline-block;     
	vertical-align: top;  
  color: blue;  
}
.blintemp{
	display: inline-block;	
	color: blue;
}
.blintempvalue{	
	display: inline-block; 
	vertical-align: top;	
	text-align: left;	
}
.blintempunit{
	display: inline-block;     
	vertical-align: top;  
	margin-top: 5px;
}
.blinhumvalue{	
	display: inline-block; 
	vertical-align: top;	
	text-align: right;
}
.blinhumunit{
	display: inline-block;     
	vertical-align: top;  
	margin-top: 5px;
	text-align: right;
}


* {
  box-sizing: border-box;
}
/* Use a media query to add a break point at 800px: */
/* ── Landscape hint for mobile ──────────────────────────── */
@media screen and (max-width: 600px) and (orientation: portrait) {
  body::before {
    content: "Roter skærmen for bedre visning";
    display: block;
    position: fixed;
    top: 0; left: 0; right: 0;
    background: #0a1a24;
    color: #5a9ab8;
    font-family: 'RussoOne', sans-serif;
    font-size: 0.7em;
    letter-spacing: .1rem;
    text-align: center;
    padding: 6px;
    z-index: 10000;
  }
}

/* ── Tablet / small desktop (≤ 800px) ───────────────────── */
@media screen and (max-width: 800px) {
  /* Top bar and gauge circles keep their original proportional widths —
     all 4 gauges stay on one row down to 600px. */
  /* Keep all four bottom sections on one row */
  .buttomlineDateTime  { width: 30%; }
  .buttomlineIn        { width: 30%; }
  .buttomlineWeatherPicto { width: 22%; }
  .buttomlineMoon      { width: 18%; }
  /* Tighten icon buttons on small screens */
  .btn-icon { font-size: 1.1em; padding: 3px 5px; }
  .btn-location { font-size: 0.55em; }
}

/* ── Narrow (≤ 600px): top bar, gauges and bottom row drop to 2×2 grid ── */
@media screen and (max-width: 600px) {
  .wind, .rain, .sun, .uv {
    width: 50%;
  }
  .outdoorCircle, .directionCircle, .drewpointCricle, .sensorCircle {
    width: 50%;
  }
  .buttomlineDateTime, .buttomlineIn,
  .buttomlineWeatherPicto, .buttomlineMoon {
    width: 50%;
  }
}

/* ── Mobile landscape (≤ 480px wide or ≤ 430px tall) ────── */
@media screen and (max-width: 480px) {
  #DataList .inner,
  #AlarmPanel .inner {
    width: 100%;
    padding: 8px;
  }
  #recordlist .rec1 { font-size: 0.65em; }
  #recordlist .rec2 { font-size: 1.1em; }
}

/* ── Bottom bar font scaling for mobile landscape ────────── */
/* Galaxy S23+ landscape: ~915px wide                        */
@media screen and (max-width: 960px) {
  .bldtclock { display: block; }
  .f3         { font-size: 3.6em; }
  .f3xsmal    { font-size: 1.5em; }
  /* Gauge containers are scaled via CSS transform — keep fonts at their natural
     size so the transform is the only thing that changes their visual size */
  #containerOutdoor .f3, #containerDrewpoint .f3,
  #containerSensor .f3,  #containerDirection .f3 { font-size: 5em; }
  #containerOutdoor .f3xsmal, #containerDrewpoint .f3xsmal,
  #containerSensor .f3xsmal,  #containerDirection .f3xsmal { font-size: 2em; }
  .buttomlineDateTime,
  .buttomlineIn,
  .buttomlineWeatherPicto,
  .buttomlineMoon {
    height: auto;
    min-height: 100px;
  }
}

@media screen and (max-width: 700px) {
  .f3         { font-size: 2.9em; }
  .f3xsmal    { font-size: 1.2em; }
  /* Same — preserve inside gauge containers */
  #containerOutdoor .f3, #containerDrewpoint .f3,
  #containerSensor .f3,  #containerDirection .f3 { font-size: 5em; }
  #containerOutdoor .f3xsmal, #containerDrewpoint .f3xsmal,
  #containerSensor .f3xsmal,  #containerDirection .f3xsmal { font-size: 2em; }
}

@media screen and (max-width: 600px) {
  .f3 { font-size: 5em; }
}

#containerOutdoor, #containerDirection, #container, #containerSensor, #containerDrewpoint {
  position: relative;
}

#containerDirection {
  height: 250px;
}

#container canvas, 
#overlay, 
#containerSensor canvas, 
#osdiv,
#ocdiv, 
#containerOutdoor canvas,
#dpdiv,
#containerDrewpoint canvas
{
  position: absolute;
}

.d-none{
  display:none;
}

/* ── Loading spinner ─────────────────────────────────────── */
#load-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease;
}
#load-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid #1a3a4a;
  border-top-color: lightblue;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-label {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.7em;
  letter-spacing: .12rem;
  color: #5a9ab8;
  margin-top: 16px;
  text-transform: uppercase;
}

/* ── DataList (List all data) ────────────────────────────── */
#DataList {
  clear: both;
}
#DataList .inner {
  max-width: 800px;
  width: 90%;
  margin: 0 auto;
  padding: 10px;
  background: #000;
  border-top: 1px solid #1a3a4a;
}
#recordlist .rectitle {
  background: #0d2d40;
  color: lightblue;
  font-family: 'RussoOne', sans-serif;
  font-size: 0.68em;
  letter-spacing: .14rem;
  text-transform: uppercase;
  padding: 7px 10px;
  border-left: 3px solid #1a6080;
}
#recordlist .rec1 {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.72em;
  color: #5a9ab8;
  padding: 5px 10px;
  width: 55%;
}
#recordlist .rec2 {
  font-family: 'largedigit', monospace;
  font-size: 1.3em;
  color: lightblue;
  text-align: right;
  padding: 4px 8px;
  width: auto;
}
#recordlist .rec3 {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.68em;
  color: #5a9ab8;
  padding: 4px 4px;
  width: 40px;
}
#recordlist tr {
  border-bottom: 1px solid #0a1e2a;
}
#recordlist tr:hover td {
  background: #05121c;
}
#recordlist .f3 {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.72em;
  color: #e8a020;
  padding: 5px 10px;
  letter-spacing: .05rem;
}

/* ── AlarmPanel ──────────────────────────────────────────── */
#AlarmPanel {
  clear: both;
}
#AlarmPanel .inner {
  max-width: 800px;
  width: 90%;
  margin: 0 auto;
  padding: 10px;
  background: #0a0000;
  border-top: 2px solid #803030;
}

/* ── Moon widget ─────────────────────────────────────────── */
.moon-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto;
}
.moon-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
#moonCanvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

/* ── Status bar (inside DataList) ───────────────────────────*/
#status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
#battery-status {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.65em;
  letter-spacing: .06rem;
  color: #e8a020;
}
#status {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.65em;
  letter-spacing: .05rem;
  color: #5a9ab8;
  text-align: right;
}

/* ── Alert status button ─────────────────────────────────── */
.btn-alarm-status {
  cursor: pointer;
  z-index: 99;
  background: transparent;
  border-color: #3a1010;
  color: #804040;
}
.btn-alarm-status:hover { border-color: #803030; color: #ffaaaa; background: #1a0505; }
.btn-alarm-status.btn-alarm-active { color: #E24B4A; border-color: #E24B4A; }
.btn-alarm-status.btn-alarm-active:hover { background: #2a0808; }
#alarm-count-badge {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.6em;
  vertical-align: top;
  margin-left: 1px;
}

/* ── Location toggle button ──────────────────────────────── */
.btn-location {
  display: block;
  width: 100%;
  cursor: pointer;
  z-index: 99;
  background: #0a1a24;
  color: #5a9ab8;
  border: 1px solid #1a3a4a;
  border-radius: 4px;
  font-family: 'RussoOne', sans-serif;
  font-size: 0.65em;
  letter-spacing: .08rem;
  text-transform: uppercase;
  padding: 5px 6px;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-location:hover { background: #0e2a3a; border-color: lightblue; color: lightblue; }

/* ── Icon button row ─────────────────────────────────────── */
.btn-icon-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* ── Icon buttons (Grafer, List all data, Alert) ─────────── */
.btn-icon {
  cursor: pointer;
  z-index: 99;
  background: transparent;
  border: 1px solid #1a3a4a;
  border-radius: 4px;
  color: #5a9ab8;
  font-size: 1.1em;
  line-height: 1;
  padding: 2px 6px;
  margin-bottom: 3px;
}
.btn-icon:hover { color: lightblue; border-color: lightblue; background: #05121c; }
#btn-grafer.graph-open { color: lightblue; border-color: lightblue; }

/* ── Collector status button ─────────────────────────────── */
.btn-collector-status {
  cursor: pointer;
  z-index: 99;
  background: #1a1a0a;
  color: #606030;
}
.btn-collector-status.btn-collector-warn {
  background: #c87800;
  color: #fff;
}

/* ── Collector panel ─────────────────────────────────────── */
#CollectorPanel {
  clear: both;
}
#CollectorPanel .inner {
  max-width: 800px;
  width: 90%;
  margin: 0 auto;
  padding: 10px;
  background: #0a0a00;
  border-top: 2px solid #806000;
}
.collector-title {
  color: #e8a020 !important;
}
.collector-row-ok {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.68em;
  letter-spacing: .06rem;
  color: #5a9ab8;
  padding: 8px 0;
}

/* ── Config alert editor selects ────────────────────────────*/
.field-select {
  flex: 1;
  background: #0a1a24;
  color: lightblue;
  border: 1px solid #1a5070;
  border-radius: 4px;
  padding: 6px 8px;
  font-family: 'RussoOne', sans-serif;
  font-size: 0.72em;
}

/* ── AlarmPanel header elements ─────────────────────────── */
.alarm-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.alarm-title {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.7em;
  letter-spacing: .15rem;
  color: #ff6060;
  text-transform: uppercase;
  flex: 1;
}
.alarm-count {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.65em;
  color: #ff8080;
}
.btn-dismiss-all {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.62em;
  letter-spacing: .08rem;
  text-transform: uppercase;
  background: #2a0808;
  color: #ffaaaa;
  border: 1px solid #803030;
  border-radius: 4px;
  padding: 5px 12px;
  cursor: pointer;
}

/* ── Graph overlay toggles ───────────────────────────────── */
.graph-toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
}
.toggle-label {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.6em;
  color: #3a6a7a;
  letter-spacing: .06rem;
  white-space: nowrap;
  margin-right: 2px;
}
.graph-toggle {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.6em;
  letter-spacing: .06rem;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid #1a3a4a;
  border-radius: 3px;
  color: #3a6a7a;
  padding: 2px 7px;
  cursor: pointer;
  white-space: nowrap;
}
.graph-toggle.active {
  background: #0a1e2e;
  border-color: #5a9ab8;
  color: #5a9ab8;
}
.graph-toggle:hover { border-color: #5a9ab8; color: #5a9ab8; }
.graph-historic-sel { width: auto; padding: 2px 6px; font-size: 0.6em; }

/* ── History graph section ───────────────────────────────── */
#graph-section {
  clear: both;
}
#graph-section .inner {
  max-width: 800px;
  width: 90%;
  margin: 0 auto;
  background: #000;
  padding: 10px;
  border-radius: 0 0 4px 4px;
}
.graph-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.hist-status {
  color: #5a9ab8;
  font-family: 'RussoOne', sans-serif;
  font-size: 0.65em;
  letter-spacing: .05rem;
}
.graph-canvas-wrap {
  position: relative;
  height: 260px;
  background: #050d14;
  border: 1px solid #1a3a4a;
  border-radius: 4px;
  padding: 4px;
}

/* ── Alarm panel rows ────────────────────────────────────── */
.alarm-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 8px 0;
  border-bottom: 1px solid #1a0808;
}
.alarm-row-sensor {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.75em;
  letter-spacing: .08rem;
  color: lightblue;
  min-width: 80px;
}
.alarm-row-cond {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.7em;
  letter-spacing: .06rem;
  color: #ff8080;
  flex: 1;
}
.alarm-row-val {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.82em;
  color: #ffaaaa;
  letter-spacing: .05rem;
}
.alarm-row-ts {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.62em;
  color: #804040;
  letter-spacing: .04rem;
}
.btn-dismiss {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.6em;
  letter-spacing: .08rem;
  text-transform: uppercase;
  background: #2a0808;
  color: #ffaaaa;
  border: 1px solid #803030;
  border-radius: 3px;
  padding: 4px 10px;
  cursor: pointer;
}

/* ── Sensor detail hover popup ──────────────────────────── */
.sensor-popup {
  display: none;
  position: fixed;
  background: #050f18;
  border: 1px solid #1a3a4a;
  border-radius: 4px;
  padding: 8px 12px;
  font-family: 'RussoOne', sans-serif;
  font-size: 0.62em;
  letter-spacing: .05rem;
  color: #5a9ab8;
  z-index: 300;
  pointer-events: none;
  min-width: 180px;
}
.sp-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 0;
  border-bottom: 1px solid #0d2535;
}
.sp-row:last-child { border-bottom: none; }
.sp-label { opacity: 0.7; }
.sp-val   { text-align: right; color: #c0dff0; }

/* ── Load error popup ────────────────────────────────────── */
#load-error-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}
#load-error-overlay.visible { display: flex; }
.load-error-box {
  background: #050f18;
  border: 1px solid #803030;
  border-radius: 8px;
  padding: 24px 28px;
  max-width: 380px;
  width: 90%;
}
.load-error-title {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.7em;
  letter-spacing: .12rem;
  text-transform: uppercase;
  color: #ff6060;
  margin: 0 0 10px;
}
.load-error-msg {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.72em;
  letter-spacing: .05rem;
  color: #ffaaaa;
  margin: 0 0 20px;
}
.load-error-btns {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.btn-retry {
  font-family: 'RussoOne', sans-serif;
  font-size: 0.7em;
  letter-spacing: .1rem;
  text-transform: uppercase;
  background: #0a3020;
  color: #7fffd4;
  border: 1px solid #1a8050;
  border-radius: 4px;
  padding: 7px 14px;
  cursor: pointer;
}
.btn-retry:hover { background: #0e4030; }
