/*
RedHawk Clean TOP CNC V5.2
Built: 2026-06-17 11:37:26 MST
Purpose: one simple owner/local/private command strip, always above the normal header, zero public-visitor interference.
*/
:root {
  --rhc-red:#e11d2e;
  --rhc-blue:#287dff;
  --rhc-gold:#ffd166;
  --rhc-green:#7dffab;
  --rhc-bg:#020306;
  --rhc-panel:rgba(4,7,12,.97);
  --rhc-border:rgba(255,255,255,.16);
  --rhc-muted:#aab7ca;
  --rhc-h:30px;
}

body.rhc-controller-ready {
  padding-top: 136px !important;
}

body.rhc-controller-ready.rhd-has-context {
  padding-top: 172px !important;
}

#rhd-active-header-controller {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: var(--rhc-h) !important;
  min-height: var(--rhc-h) !important;
  z-index: 2147483647 !important;
  background: linear-gradient(90deg, #05070c, #111827 48%, #07111f) !important;
  border-bottom: 1px solid rgba(255,209,102,.58) !important;
  box-shadow: 0 8px 26px rgba(0,0,0,.55) !important;
  color: #fff !important;
  font-family: Segoe UI, Arial, sans-serif !important;
  backdrop-filter: blur(10px);
}

#rhd-active-header-controller .rhc-wrap {
  width: min(1560px, calc(100% - 12px));
  margin: 0 auto;
  height: var(--rhc-h);
  min-height: var(--rhc-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

#rhd-active-header-controller .rhc-brand {
  display:flex;
  align-items:center;
  gap:7px;
  min-width: 148px;
}

#rhd-active-header-controller .rhc-mark {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(255,255,255,.96);
  display:grid;
  place-items:center;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.25);
}

#rhd-active-header-controller .rhc-mark img {
  max-width: 100%;
  max-height: 100%;
  display:block;
}

#rhd-active-header-controller .rhc-title b {
  display:inline-block;
  font-size: 10px;
  letter-spacing: .10em;
  color:#fff;
  line-height: 1;
}

#rhd-active-header-controller .rhc-title span {
  display:inline-block;
  margin-left: 5px;
  font-size: 8px;
  color: var(--rhc-gold);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

#rhd-active-header-controller .rhc-nav {
  display:flex;
  gap:5px;
  flex-wrap:nowrap;
  justify-content:center;
  align-items:center;
  overflow:hidden;
}

#rhd-active-header-controller .rhc-btn {
  border:1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.055);
  color:#fff;
  text-decoration:none;
  border-radius:999px;
  padding:5px 8px;
  font-size:10px;
  font-weight:900;
  cursor:pointer;
  line-height:1;
  display:inline-flex;
  align-items:center;
  gap:4px;
  white-space:nowrap;
}

#rhd-active-header-controller .rhc-btn:hover,
#rhd-active-header-controller .rhc-btn.rhc-active {
  border-color:#ff6a78;
  background:linear-gradient(135deg, rgba(225,29,46,.95), rgba(125,6,17,.92));
}

#rhd-active-header-controller .rhc-btn.rhc-blue {
  border-color:rgba(107,165,255,.55);
  background:linear-gradient(135deg, rgba(40,125,255,.92), rgba(16,42,117,.88));
}

#rhd-active-header-controller .rhc-btn.rhc-quiet {
  background: rgba(255,255,255,.025);
  color: #dbe7ff;
}

#rhd-active-header-controller .rhc-status {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
  min-width: 160px;
  font-size: 10px;
  color: var(--rhc-muted);
  white-space:nowrap;
}

#rhd-active-header-controller .rhc-dot {
  width:7px;
  height:7px;
  border-radius:99px;
  background:var(--rhc-gold);
  box-shadow:0 0 10px currentColor;
}

#rhd-active-header-controller .rhc-dot.rhc-ok { background:var(--rhc-green); }
#rhd-active-header-controller .rhc-dot.rhc-bad { background:#ff6a78; }
#rhd-active-header-controller .rhc-dot.rhc-visual { background:var(--rhc-gold); }

#rhd-active-header-controller .rhc-panel {
  position:absolute;
  top:34px;
  right:8px;
  width:min(390px, calc(100vw - 16px));
  max-height:70vh;
  overflow:auto;
  border:1px solid var(--rhc-border);
  background:var(--rhc-panel);
  border-radius:14px;
  box-shadow:0 28px 90px rgba(0,0,0,.62);
  padding:12px;
  display:none;
}

#rhd-active-header-controller.rhc-open .rhc-panel {
  display:block;
}

#rhd-active-header-controller .rhc-panel h3 {
  margin:0 0 8px;
  font-size:15px;
}

#rhd-active-header-controller .rhc-panel p {
  color:var(--rhc-muted);
  font-size:12px;
  margin:7px 0;
  line-height:1.38;
}

#rhd-active-header-controller .rhc-grid {
  display:grid;
  grid-template-columns: 1fr;
  gap:7px;
}

#rhd-active-header-controller .rhc-mini {
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
  border-radius:12px;
  padding:9px;
  font-size:12px;
}

/* Force the regular public header to sit below CNC only when CNC is visible. */
body.rhc-controller-ready #rhd-global-header {
  top: var(--rhc-h) !important;
  z-index: 2147483000 !important;
}

body.rhc-controller-ready .rhd-global-header {
  top: var(--rhc-h) !important;
}

/* Public-server safety: CNC hidden on public RedHawk unless owner-enabled. */
body.rhc-public-safe-hide {
  padding-top: 106px !important;
}

body.rhc-public-safe-hide.rhd-has-context {
  padding-top: 148px !important;
}

body.rhc-public-safe-hide #rhd-active-header-controller {
  display: none !important;
}

body.rhc-public-safe-hide #rhd-global-header {
  top: 0 !important;
}

@media(max-width: 980px) {
  body.rhc-controller-ready {
    padding-top: 168px !important;
  }
  body.rhc-controller-ready.rhd-has-context {
    padding-top: 205px !important;
  }
  #rhd-active-header-controller {
    height: 64px !important;
    min-height: 64px !important;
  }
  #rhd-active-header-controller .rhc-wrap {
    grid-template-columns: 1fr;
    gap:3px;
    height:64px;
    padding:4px 0;
  }
  #rhd-active-header-controller .rhc-brand,
  #rhd-active-header-controller .rhc-status {
    min-width:0;
    justify-content:center;
  }
  #rhd-active-header-controller .rhc-title span {
    display:none;
  }
  body.rhc-controller-ready #rhd-global-header {
    top:64px !important;
  }
  #rhd-active-header-controller .rhc-panel {
    top:68px;
  }
  body.rhc-public-safe-hide {
    padding-top:106px !important;
  }
  body.rhc-public-safe-hide #rhd-global-header {
    top:0 !important;
  }
}

@media print {
  #rhd-active-header-controller { display:none !important; }
  body.rhc-controller-ready { padding-top:0 !important; }
  #rhd-global-header { top:0 !important; }
}
