:root{
  color-scheme:dark;
  --bg:#081018;
  --panel:#111b26;
  --panel2:#162331;
  --line:#283b4d;
  --text:#f3f7fb;
  --muted:#96a8ba;
  --accent:#71b7ff;
  --good:#43d17d;
  --warn:#f4bf4f;
  --bad:#ff6673;
  --none:#536476;

  --t-system:#71b7ff;
  --t-cpu:#ff9270;
  --t-d1:#58d68d;
  --t-d2:#d58cff;

  --l-cpu:#ff9270;
  --l-ram:#71b7ff;
  --l-d1:#58d68d;
  --l-d2:#d58cff;

  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

*{box-sizing:border-box}

body{
  margin:0;
  min-height:100vh;
  padding:26px 15px 45px;
  color:var(--text);
  background:
    radial-gradient(circle at 50% -8%,rgba(67,126,177,.28),transparent 32rem),
    var(--bg);
}

button,input{font:inherit}

.page{
  width:min(1180px,100%);
  margin:auto;
}

.top{
  display:flex;
  justify-content:space-between;
  gap:20px;
  align-items:flex-start;
}

.eyebrow{
  margin:0 0 7px;
  color:var(--accent);
  font-size:.8rem;
  font-weight:800;
  letter-spacing:.11em;
  text-transform:uppercase;
}

h1{
  margin:0;
  font-size:clamp(2.1rem,7vw,3.7rem);
  line-height:1;
  letter-spacing:-.045em;
}

.intro{
  max-width:720px;
  color:var(--muted);
  line-height:1.55;
}

.top-links{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.top-links a,
.toolbar button{
  border:1px solid var(--line);
  border-radius:12px;
  padding:9px 12px;
  color:var(--text);
  background:var(--panel2);
  text-decoration:none;
}

.toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin:22px 0 14px;
  flex-wrap:wrap;
}

.ranges,.toolbar-right{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  align-items:center;
}

.toolbar button{
  cursor:pointer;
  color:var(--muted);
  border-radius:999px;
}

.toolbar button.active{
  color:var(--text);
  border-color:var(--accent);
}

.toolbar button:disabled{
  opacity:.4;
  cursor:not-allowed;
}

.live-switch{
  display:flex;
  gap:7px;
  align-items:center;
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--panel);
  color:var(--muted);
}

.live-switch input{
  accent-color:var(--accent);
}

.health-banner,
.panel,
.current-card{
  border:1px solid var(--line);
  background:rgba(17,27,38,.95);
  box-shadow:0 20px 60px rgba(0,0,0,.20);
}

.health-banner{
  border-radius:14px;
  padding:11px 15px;
  color:var(--muted);
  margin-bottom:12px;
}

.health-banner.good{color:var(--good)}
.health-banner.bad{color:var(--bad)}
.health-banner.warn{color:var(--warn)}

.current-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-bottom:12px;
}

.current-card{
  border-radius:15px;
  padding:14px 15px;
  min-width:0;
}

.current-label{
  color:var(--muted);
  font-size:.73rem;
  text-transform:uppercase;
  letter-spacing:.06em;
}

.current-value{
  margin-top:5px;
  font-size:1.45rem;
  font-weight:850;
  letter-spacing:-.03em;
}

.current-sub{
  margin-top:4px;
  color:var(--muted);
  font-size:.72rem;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.panel{
  border-radius:18px;
  margin-bottom:12px;
  overflow:hidden;
}

.panel-head{
  display:flex;
  justify-content:space-between;
  gap:18px;
  align-items:flex-start;
  padding:17px 18px 5px;
}

.panel-head h2{
  margin:0;
  font-size:1.05rem;
}

.panel-head p{
  margin:5px 0 0;
  color:var(--muted);
  font-size:.8rem;
}

.toggles{
  display:flex;
  justify-content:flex-end;
  gap:7px;
  flex-wrap:wrap;
}

.toggle{
  cursor:pointer;
  display:flex;
  gap:6px;
  align-items:center;
  border:1px solid var(--line);
  border-radius:999px;
  padding:7px 10px;
  color:var(--muted);
  background:var(--panel2);
  font-size:.78rem;
}

.toggle input{
  margin:0;
}

.dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--series);
}

.chart-wrap{
  position:relative;
  padding:6px 10px 12px;
}

.chart{
  position:relative;
  width:100%;
  min-height:285px;
  user-select:none;
  touch-action:none;
}

.chart svg{
  display:block;
  width:100%;
  height:auto;
  overflow:visible;
}

.empty{
  height:270px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
}

.selection{
  fill:rgba(113,183,255,.15);
  stroke:var(--accent);
  stroke-width:1;
}

.fan-panel{
  padding-bottom:16px;
}

.fan-bar{
  display:flex;
  margin:14px 18px 10px;
  height:30px;
  border-radius:8px;
  overflow:hidden;
  background:var(--none);
}

.fan-segment{
  min-width:1px;
  height:100%;
}

.fan-segment.low{background:#4bb887}
.fan-segment.high{background:#d6a744}
.fan-segment.full{background:#e8666f}
.fan-segment.unknown{background:var(--none)}

.fan-legend{
  display:flex;
  flex-wrap:wrap;
  gap:13px;
  padding:0 18px;
  color:var(--muted);
  font-size:.76rem;
}

.fan-legend span::before{
  content:"";
  display:inline-block;
  width:9px;
  height:9px;
  border-radius:3px;
  margin-right:5px;
}

.fan-low::before{background:#4bb887}
.fan-high::before{background:#d6a744}
.fan-full::before{background:#e8666f}
.fan-unknown::before{background:var(--none)}

.details-panel{
  padding-bottom:14px;
}

.diagnostic-info{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  padding:10px 18px 5px;
}

.info-item{
  padding:10px 12px;
  border:1px solid var(--line);
  background:var(--panel2);
  border-radius:11px;
}

.info-label{
  color:var(--muted);
  font-size:.7rem;
}

.info-value{
  margin-top:3px;
  font-weight:750;
  word-break:break-word;
}

.tooltip{
  position:fixed;
  z-index:100;
  pointer-events:none;
  min-width:220px;
  max-width:300px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:11px;
  background:rgba(8,16,24,.96);
  box-shadow:0 12px 35px rgba(0,0,0,.45);
  font-size:.76rem;
}

.tooltip-time{
  margin-bottom:7px;
  font-weight:800;
}

.tooltip-row{
  display:flex;
  justify-content:space-between;
  gap:16px;
  color:var(--muted);
  margin-top:3px;
}

.tooltip-row strong{
  color:var(--text);
}

.hidden{display:none}

footer{
  color:var(--muted);
  font-size:.76rem;
  margin-top:20px;
}

@media(max-width:850px){
  .current-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .diagnostic-info{grid-template-columns:1fr 1fr}
}

@media(max-width:650px){
  body{padding:20px 10px 40px}
  .top{flex-direction:column}
  .panel-head{flex-direction:column}
  .toggles{justify-content:flex-start}
  .chart{min-height:245px}
  .current-grid{grid-template-columns:1fr 1fr}
  .diagnostic-info{grid-template-columns:1fr}
}

@media(max-width:420px){
  .current-grid{grid-template-columns:1fr}
}

/* NASDIAG CURRENT CARD COLORS */
.current-card{
  --card-accent:var(--accent);
  box-shadow:
    inset 3px 0 0 var(--card-accent),
    0 20px 60px rgba(0,0,0,.20);
}

.current-label{
  color:var(--card-accent);
}

.current-label::before{
  content:"";
  display:inline-block;
  width:7px;
  height:7px;
  margin-right:7px;
  border-radius:50%;
  background:var(--card-accent);
  vertical-align:1px;
  opacity:.9;
}


/* Einheitliche Seitennavigation */
.global-nav{
  display:flex;
  justify-content:flex-end;
  gap:7px;
  flex-wrap:wrap;
}
.global-nav-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 11px;
  border:1px solid var(--line);
  border-radius:999px;
  color:var(--muted);
  background:var(--panel2);
  text-decoration:none;
  font-size:.8rem;
  font-weight:720;
}
.global-nav-link:hover{
  color:var(--text);
}
.global-nav-link.active{
  color:var(--text);
  border-color:var(--accent);
}

/* NASDIAG FAN CONTROL */
.fan-control{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
  margin:4px 18px 5px;
  padding:12px 13px;
  border:1px solid var(--line);
  border-radius:11px;
  background:var(--panel2);
}

.fan-control-buttons{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
}

.fan-mode-btn{
  appearance:none;
  border:1px solid var(--line);
  border-radius:9px;
  padding:8px 11px;
  background:rgba(255,255,255,.025);
  color:var(--muted);
  font:inherit;
  font-size:.79rem;
  font-weight:720;
  cursor:pointer;
  transition:
    border-color .15s,
    color .15s,
    background .15s,
    opacity .15s;
}

.fan-mode-btn:hover:not(:disabled){
  color:var(--text);
  border-color:#58718a;
}

.fan-mode-btn:disabled{
  cursor:not-allowed;
  opacity:.48;
}

.fan-mode-btn.active{
  color:var(--text);
}

.fan-mode-btn.active[data-fan-mode="low"]{
  border-color:#4bb887;
  background:rgba(75,184,135,.09);
}

.fan-mode-btn.active[data-fan-mode="high"]{
  border-color:#d6a744;
  background:rgba(214,167,68,.09);
}

.fan-mode-btn.active[data-fan-mode="full"]{
  border-color:#e8666f;
  background:rgba(232,102,111,.09);
}

.fan-control-status{
  color:var(--muted);
  font-size:.76rem;
  min-height:1.2em;
}

.fan-control-status.error{
  color:#e8666f;
}

.fan-control-status.pending{
  color:var(--accent);
}

@media(max-width:720px){
  .fan-control{
    align-items:flex-start;
    flex-direction:column;
  }

  .fan-control-buttons{
    width:100%;
  }

  .fan-mode-btn{
    flex:1 1 auto;
  }
}

/* NASDIAG FAN SCHEDULE */

.fan-schedule-row{
  flex:1 0 100%;
  display:flex;
  align-items:center;
  gap:11px;
  flex-wrap:wrap;
  padding-top:4px;
}

.fan-schedule-open,
.fan-schedule-secondary,
.fan-schedule-save{
  appearance:none;
  border:1px solid var(--line);
  border-radius:9px;
  padding:8px 11px;
  font:inherit;
  font-size:.78rem;
  font-weight:720;
  cursor:pointer;
}

.fan-schedule-open,
.fan-schedule-secondary{
  background:rgba(255,255,255,.025);
  color:var(--muted);
}

.fan-schedule-open:hover,
.fan-schedule-secondary:hover{
  color:var(--text);
  border-color:#58718a;
}

.fan-schedule-save{
  background:rgba(113,183,255,.10);
  border-color:var(--accent);
  color:var(--text);
}

.fan-schedule-summary{
  color:var(--muted);
  font-size:.76rem;
}

.fan-schedule-editor{
  flex:1 0 100%;
  margin-top:5px;
  padding:13px;
  border-top:1px solid var(--line);
}

.fan-schedule-editor.is-hidden{
  display:none;
}

.fan-schedule-editor-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}

.fan-schedule-enable{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:.82rem;
  font-weight:720;
}

.fan-schedule-timezone{
  color:var(--muted);
  font-size:.72rem;
}

.fan-schedule-rules{
  display:flex;
  flex-direction:column;
  gap:9px;
}

.fan-schedule-rule{
  display:grid;
  grid-template-columns:100px 145px minmax(280px,1fr) auto;
  gap:10px;
  align-items:center;
  padding:10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:rgba(255,255,255,.018);
}

.fan-schedule-rule input[type="time"],
.fan-schedule-rule select{
  width:100%;
  box-sizing:border-box;
  border:1px solid var(--line);
  border-radius:8px;
  padding:7px 8px;
  background:#08121d;
  color:var(--text);
  font:inherit;
  font-size:.78rem;
}

.fan-schedule-days{
  display:flex;
  gap:4px;
  flex-wrap:wrap;
}

.fan-schedule-day{
  width:31px;
  height:29px;
  padding:0;
  border:1px solid var(--line);
  border-radius:7px;
  background:transparent;
  color:var(--muted);
  font:inherit;
  font-size:.7rem;
  cursor:pointer;
}

.fan-schedule-day.selected{
  border-color:var(--accent);
  background:rgba(113,183,255,.10);
  color:var(--text);
}

.fan-schedule-delete{
  border:0;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
  font:inherit;
  font-size:.76rem;
}

.fan-schedule-delete:hover{
  color:#e8666f;
}

.fan-schedule-actions{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-top:11px;
}

.fan-schedule-actions-right{
  display:flex;
  gap:7px;
}

.fan-schedule-note{
  margin-top:11px;
  color:var(--muted);
  font-size:.7rem;
  line-height:1.45;
}

.fan-schedule-message{
  min-height:1.2em;
  margin-top:7px;
  color:var(--muted);
  font-size:.75rem;
}

.fan-schedule-message.error{
  color:#e8666f;
}

.fan-schedule-message.ok{
  color:#4bb887;
}

@media(max-width:850px){
  .fan-schedule-rule{
    grid-template-columns:1fr 1fr;
  }

  .fan-schedule-days{
    grid-column:1 / -1;
  }
}

@media(max-width:520px){
  .fan-schedule-rule{
    grid-template-columns:1fr;
  }

  .fan-schedule-days{
    grid-column:auto;
  }

  .fan-schedule-actions{
    align-items:stretch;
    flex-direction:column;
  }

  .fan-schedule-actions-right{
    width:100%;
  }

  .fan-schedule-actions-right button{
    flex:1;
  }
}

/* NASDIAG CROSSOVER PROFILE */

.fan-profile-control{
  flex:1 0 100%;
  padding:11px 0 3px;
  border-top:1px solid var(--line);
}

.fan-profile-top{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.fan-profile-label{
  color:var(--muted);
  font-size:.74rem;
  font-weight:720;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.fan-profile-switch{
  display:inline-flex;
  padding:3px;
  border:1px solid var(--line);
  border-radius:10px;
  background:rgba(255,255,255,.018);
}

.fan-profile-btn{
  appearance:none;
  border:0;
  border-radius:7px;
  padding:7px 11px;
  background:transparent;
  color:var(--muted);
  font:inherit;
  font-size:.77rem;
  font-weight:720;
  cursor:pointer;
}

.fan-profile-btn:hover:not(:disabled){
  color:var(--text);
}

.fan-profile-btn.active{
  background:rgba(113,183,255,.11);
  color:var(--text);
  box-shadow:inset 0 0 0 1px rgba(113,183,255,.30);
}

.fan-profile-btn:disabled{
  opacity:.48;
  cursor:not-allowed;
}

.fan-profile-status{
  margin-top:8px;
  color:var(--muted);
  font-size:.76rem;
}

.fan-profile-status.pending{
  color:var(--accent);
}

.fan-profile-status.running{
  color:#4bb887;
}

.fan-profile-status.error{
  color:#e8666f;
}

.fan-profile-detail{
  display:none;
  margin-top:9px;
  padding:9px 11px;
  border:1px solid var(--line);
  border-radius:9px;
  background:rgba(255,255,255,.015);
  color:var(--muted);
  font-size:.73rem;
  line-height:1.55;
}

.fan-profile-detail.visible{
  display:block;
}

.fan-profile-detail strong{
  color:var(--text);
}

.fan-profile-warning{
  color:#d6a744;
}

@media(max-width:520px){
  .fan-profile-top{
    align-items:flex-start;
    flex-direction:column;
  }

  .fan-profile-switch{
    width:100%;
  }

  .fan-profile-btn{
    flex:1;
  }
}
