/* The QMD `.compass` element is only a trigger for the shared overlay. */
.compass-inline-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 2.6rem;
  height: 2.6rem;
  margin: 0.45rem 0;
  border: 2px solid #5a3300;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #f5d98b, #b8860b 60%, #6b4c00 100%);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.38), inset 0 1px 3px rgba(255, 240, 150, 0.5);
  color: #3b1800;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}
.compass-inline-trigger:hover,
.compass-inline-trigger:focus-visible {
  box-shadow: 0 0 10px rgba(255, 210, 80, 0.9), 0 3px 7px rgba(0, 0, 0, 0.42), inset 0 1px 3px rgba(255, 240, 150, 0.66);
  filter: brightness(1.08);
  outline: 2px solid rgba(184, 134, 11, 0.52);
  outline-offset: 2px;
  transform: scale(1.08);
}
.compass-inline-trigger--unresolved { width: auto; color: #7d1f1f; font-style: italic; }

/*
 * Focused local-tree view inside the existing compass overlay.  It is a
 * small, non-modal guide: a soft blue field gives the brass topology room to
 * breathe without becoming a rigid card or a second page-level interface.
 */
#toc-compass.compass-local-focus {
  display: none;
  box-sizing: border-box;
  width: min(460px, calc(100vw - 18px));
  height: min(340px, calc(100vh - 18px));
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  touch-action: auto;
}
#toc-compass.compass-local-focus.open { display: block; }
#toc-compass.compass-local-focus::before {
  position: absolute;
  inset: 1.25rem 0.8rem 0.4rem;
  border-radius: 50% 50% 44% 44% / 36% 36% 58% 58%;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(225, 246, 255, 0.86) 0 15%, rgba(150, 205, 239, 0.68) 48%, rgba(89, 154, 204, 0.18) 76%, transparent 100%);
  filter: blur(12px);
  content: "";
  opacity: 0.95;
  pointer-events: none;
}
#toc-compass.compass-local-focus::after {
  position: absolute;
  inset: 3rem 2.25rem 1rem;
  border-radius: 50%;
  background: rgba(105, 178, 222, 0.18);
  box-shadow: 0 0 30px 18px rgba(125, 195, 235, 0.28);
  content: "";
  pointer-events: none;
}
#toc-compass.compass-local-focus #compass-close {
  display: none;
}
.compass-focus-view {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}
.compass-focus-wires {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.compass-focus-wire {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.compass-focus-wire--rim {
  stroke: rgba(92, 49, 14, 0.92);
  stroke-width: 5.2;
  filter: drop-shadow(0 1px 1px rgba(44, 27, 8, 0.34));
}
.compass-focus-wire--core {
  stroke: #c8843d;
  stroke-width: 2.35;
}
.compass-focus-parent,
.compass-focus-level,
.compass-focus-children {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.compass-focus-node {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  color: #3b1800;
  text-decoration: none;
  pointer-events: auto;
}
.compass-focus-node .fa-brass-icon {
  width: 2.3rem;
  height: 2.3rem;
  margin: 0;
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}
.compass-focus-node--center .fa-brass-icon {
  width: 2.65rem;
  height: 2.65rem;
  border-width: 3px;
  box-shadow: 0 0 0 4px rgba(255, 241, 160, 0.55), 0 0 16px rgba(255, 210, 80, 0.95), inset 0 1px 4px rgba(255, 250, 200, 0.72);
}
.compass-focus-node--sibling .fa-brass-icon {
  filter: saturate(0.82) brightness(0.9);
}
.compass-focus-node:hover .fa-brass-icon,
.compass-focus-node:focus-visible .fa-brass-icon {
  box-shadow: 0 0 14px rgba(255, 235, 120, 1), 0 4px 8px rgba(0, 0, 0, 0.48), inset 0 1px 4px rgba(255, 250, 200, 0.76);
  filter: brightness(1.12);
  transform: scale(1.12);
}
.compass-focus-node:focus-visible { outline: 0; }
.compass-focus-node__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 540px) {
  #toc-compass.compass-local-focus {
    width: min(360px, calc(100vw - 16px));
    height: min(300px, calc(100vh - 16px));
  }
  .compass-focus-node .fa-brass-icon { width: 2rem; height: 2rem; }
  .compass-focus-node--center .fa-brass-icon { width: 2.35rem; height: 2.35rem; }
  .compass-focus-wire--rim { stroke-width: 4.6; }
  .compass-focus-wire--core { stroke-width: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .compass-inline-trigger, .compass-focus-node .fa-brass-icon { transition: none; }
}
