/* Humanofil Human Primacy Instrument v1
   Scoped to hf-*; no reader, hero, navigation, or Flow styles are modified. */

body.hf-modal-open { overflow: hidden; }

.hf-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 4, 10, .82);
  backdrop-filter: blur(11px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, visibility .18s ease;
}
.hf-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hf-dialog {
  --hf-bg: #080b12;
  --hf-panel: #0d111a;
  --hf-ink: #f1f3f8;
  --hf-muted: #9098a8;
  --hf-line: rgba(142, 155, 184, .22);
  --hf-accent: #8d9aeb;
  --hf-accent-soft: rgba(141,154,235,.14);
  --hf-support: #70b6a0;
  --hf-support-soft: rgba(112,182,160,.13);
  --hf-warn: #c99a67;
  --hf-risk: #c97973;

  width: min(1060px, 100%);
  max-height: min(90vh, 920px);
  overflow: auto;
  border: 1px solid var(--hf-line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 14% 0%, rgba(141,154,235,.10), transparent 28%),
    radial-gradient(circle at 88% 24%, rgba(112,182,160,.06), transparent 24%),
    linear-gradient(180deg, #0a0e16 0%, var(--hf-bg) 100%);
  color: var(--hf-ink);
  box-shadow: 0 28px 90px rgba(0,0,0,.52);
  padding: 20px;
}

.hf-dialog * { box-sizing: border-box; }
.hf-dialog button,
.hf-dialog select,
.hf-dialog input { font: inherit; }

.hf-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hf-line);
}
.hf-kicker {
  margin: 0 0 6px;
  color: #a8b2ef;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .17em;
}
.hf-head h2 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(1.4rem, 2.7vw, 2.05rem);
  line-height: 1.04;
  letter-spacing: -.02em;
}
.hf-sub {
  margin: 8px 0 0;
  color: var(--hf-muted);
  font-size: 12px;
}

.hf-close,
.hf-test-button,
.hf-return-button { cursor: pointer; }

.hf-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--hf-line);
  border-radius: 9px;
  background: transparent;
  color: var(--hf-ink);
  font-size: 20px;
  line-height: 1;
}
.hf-close:hover { background: var(--hf-accent-soft); }

.hf-system-row {
  display: grid;
  grid-template-columns: auto minmax(240px, 360px);
  align-items: center;
  gap: 14px;
  margin: 14px 0;
}
.hf-system-row label,
.hf-panel h3,
.hf-reading > span,
.hf-question > span {
  color: #a9b0c0;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
}
.hf-system-row select {
  width: 100%;
  border: 1px solid var(--hf-line);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
  color: var(--hf-ink);
  padding: 9px 10px;
}

.hf-main-grid {
  display: grid;
  grid-template-columns: .75fr 1.25fr;
  gap: 12px;
}

.hf-panel {
  border: 1px solid var(--hf-line);
  border-radius: 14px;
  background: rgba(255,255,255,.02);
  padding: 13px;
}

.hf-controls {
  display: grid;
  gap: 14px;
  align-content: start;
}
.hf-panel h3 { margin: 0 0 1px; }

.hf-control label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: var(--hf-muted);
  font-size: 10px;
}
.hf-control label b { color: var(--hf-ink); }
.hf-control input[type="range"] {
  width: 100%;
  accent-color: var(--hf-accent);
}

.hf-test-button {
  margin-top: 3px;
  border: 1px solid var(--hf-accent);
  border-radius: 10px;
  background: var(--hf-accent);
  color: #070915;
  padding: 10px 12px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
}

.hf-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px;
}
.hf-metrics article {
  min-height: 72px;
  border: 1px solid var(--hf-line);
  border-radius: 11px;
  background: rgba(255,255,255,.02);
  padding: 10px;
}
.hf-metrics span {
  display: block;
  color: var(--hf-muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.hf-metrics strong {
  display: block;
  margin-top: 8px;
  color: var(--hf-ink);
  font-size: 1rem;
}

.hf-map {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 2px;
}
.hf-outer-field {
  fill: none;
  stroke: var(--hf-line);
  stroke-width: 2;
}
.hf-human-field {
  fill: var(--hf-accent-soft);
  stroke: var(--hf-accent);
  stroke-width: 3;
  transition: r .22s ease;
}
.hf-human-core { fill: var(--hf-accent); }
.hf-human-text,
.hf-human-text-small {
  fill: white;
  font-size: 13px;
  font-weight: 800;
}
.hf-human-text-small { font-size: 10px; letter-spacing: .08em; }

.hf-relation-line {
  fill: none;
  stroke: var(--hf-support);
  stroke-width: 4;
  stroke-linecap: round;
  transition: d .22s ease;
}
.hf-tech-node {
  fill: var(--hf-support-soft);
  stroke: var(--hf-support);
  stroke-width: 3;
  transition: r .22s ease, cx .22s ease;
}
.hf-tech-text {
  fill: var(--hf-ink);
  font-size: 11px;
  font-weight: 800;
}
.hf-map-label {
  fill: var(--hf-muted);
  font-size: 10px;
  letter-spacing: .06em;
}

.hf-reading,
.hf-question {
  margin-top: 10px;
  border: 1px solid var(--hf-line);
  border-radius: 12px;
  background: rgba(255,255,255,.018);
  padding: 12px;
}
.hf-reading { border-left: 2px solid var(--hf-accent); }
.hf-question { border-left: 2px solid var(--hf-support); }
.hf-reading p,
.hf-question p {
  margin: 7px 0 0;
  color: #e8ebf3;
  font-size: 12px;
  line-height: 1.5;
}
.hf-question p { font-style: italic; }

.hf-orientation {
  margin-top: 10px;
  border: 1px solid var(--hf-line);
  border-radius: 12px;
  background: rgba(141,154,235,.05);
  padding: 10px 12px;
}
.hf-orientation span {
  display: block;
  color: #b5bdeb;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
}
.hf-orientation small {
  display: block;
  margin-top: 6px;
  color: #727a8b;
  font-size: 9px;
}

.hf-foot {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--hf-line);
  color: #727a8b;
  font-size: 9px;
  letter-spacing: .08em;
}
.hf-return-button {
  border: 1px solid var(--hf-line);
  border-radius: 9px;
  background: transparent;
  color: var(--hf-ink);
  padding: 8px 11px;
  font-size: 9px;
  font-weight: 800;
}
.hf-return-button:hover { background: var(--hf-accent-soft); }

@media (max-width: 820px) {
  .hf-backdrop { padding: 10px; }
  .hf-dialog { max-height: 95vh; padding: 15px; }
  .hf-main-grid { grid-template-columns: 1fr; }
  .hf-foot { grid-template-columns: 1fr auto; }
  .hf-close-hint { display: none; }
}

@media (max-width: 560px) {
  .hf-backdrop { padding: 0; place-items: stretch; }
  .hf-dialog {
    width: 100%;
    max-height: 100vh;
    min-height: 100vh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 14px;
  }
  .hf-system-row { grid-template-columns: 1fr; }
  .hf-metrics { grid-template-columns: 1fr 1fr; }
  .hf-metrics article:last-child { grid-column: 1 / -1; }
  .hf-foot { grid-template-columns: 1fr; }
  .hf-return-button { width: 100%; }
}

