/* Agent Engine — tool-calling harness page: shared primitive · two parametrizations · layer boundary.
   Loaded by _workzone/harness.html on top of module.css.
   The harness is a cross-cutting layer; its home page lives in the owner module
   (Agent Engine, the full form), mirrored on L1 as a crosscut band — same as the
   Embeddings runtime. Placement convention: docs/architecture/README.md §Styling. */

/* ═══════════════════════════════════════════
   Shared primitive — model ↔ dispatch ↔ context
   ═══════════════════════════════════════════ */
.hn-core {
  position: relative;
  border: 2px dashed var(--accent-muted);
  border-radius: var(--radius);
  padding: 1rem 0.9rem 0.7rem;
  background: var(--paper);
  margin: 0.3rem 0;
}

.hn-flow {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hn-node {
  flex: 1 1 0;
  min-width: 7rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: center;
  padding: 0.65rem 0.7rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1.5px solid var(--border);
}
.hn-node--model {
  border-color: var(--accent);
}
.hn-node--disp {
  border-color: var(--s2);
}
.hn-node--ctx {
  border-color: var(--s3);
  background: var(--s3-pale);
}
.hn-node__g {
  font-size: 1.05rem;
}
.hn-node__t {
  font-weight: 700;
  font-size: 0.82rem;
}
.hn-node__s {
  font-size: 0.71rem;
  color: var(--text-dim);
}
/* .ai-tag is inline-flex; as a direct child of the column node it would stretch
   full-width under the default align-items: stretch — pin it to hug its text. */
.hn-node .ai-tag {
  align-self: center;
  margin-left: 0;
}

.hn-edge {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 6rem;
  gap: 0.15rem;
}
.hn-edge__arr {
  color: var(--text-muted);
  font-weight: 700;
  font-family: var(--mono);
}
.hn-edge__lbl {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.25;
}

.hn-core__back {
  margin-top: 0.6rem;
  text-align: center;
  font-size: 0.74rem;
  color: var(--text-dim);
}
.hn-core__back b {
  color: var(--accent);
}

/* ── three mechanics under the primitive ── */
.hn-mech {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-top: 0.6rem;
}
.hn-mech__item {
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-top: 3px solid var(--accent-muted);
}
.hn-mech__h {
  font-weight: 700;
  font-size: 0.81rem;
}
.hn-mech__d {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

/* ═══════════════════════════════════════════
   Two parametrizations — QE (degenerate) vs AE (full)
   ═══════════════════════════════════════════ */
.hn-fork {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.7rem;
  margin: 0.3rem 0;
}
.hn-col {
  align-self: stretch;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1.5px solid var(--border);
}
.hn-col--qe {
  border-top: 3px solid var(--s2);
}
.hn-col--ae {
  border-top: 3px solid var(--accent);
}
.hn-col__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.hn-col__who {
  font-weight: 700;
  font-size: 0.88rem;
}
.hn-col__axis {
  display: grid;
  grid-template-columns: 4.6rem 1fr;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.3rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
}
.hn-col__k {
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.hn-col__v {
  color: var(--text);
}
.hn-col__d {
  margin-top: 0.5rem;
  font-size: 0.76rem;
  color: var(--text-dim);
}

.hn-fork__axis {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}
.hn-fork__base {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.hn-fork__split {
  color: var(--accent-muted);
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════
   Layer boundary — shared vs module-local (via negativa)
   ═══════════════════════════════════════════ */
.hn-split {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 0.3rem 0;
}
.hn-split__col {
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1.5px solid var(--border);
}
.hn-split__col--shared {
  border-color: var(--accent);
  background: var(--paper);
}
.hn-split__h {
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}
.hn-split__list {
  margin: 0;
  padding-left: 1.05rem;
  font-size: 0.76rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.hn-split__list li {
  margin: 0.1rem 0;
}

@media (max-width: 680px) {
  .hn-mech,
  .hn-split {
    grid-template-columns: 1fr;
  }
  .hn-fork {
    grid-template-columns: 1fr;
  }
  .hn-fork__axis {
    flex-direction: row;
  }
  .hn-fork__base {
    writing-mode: horizontal-tb;
    transform: none;
  }
}
