/* /glossary/ as a reference hub, 30 Sep 2026: tools first, guides and definitions in drop-downs.
   Theme tokens only (--bg, --surface, --text, --teal ...), so the light and dark toggle keeps working.
   Everything is scoped under .gxh. The 21 Sep definition list styles (.gx-*) live in phase2-ui.css. */

.gxh { display: grid; gap: 56px; }
.gxh-block { min-width: 0; }
.gxh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* quick bar: jump chips and the small search */
.gxh-quick { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: -24px; }
.gxh-jump { display: flex; flex-wrap: wrap; gap: 8px; }
.gxh-jump a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500; text-decoration: none !important; }
.gxh-jump a b { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; font-weight: 600; color: var(--teal); }
.gxh-jump a:nth-child(2) b { color: var(--amber); }
.gxh-jump a:nth-child(3) b { color: var(--red); }
.gxh-jump a:hover { border-color: var(--teal); }
.gxh-search { display: none; position: relative; flex: 0 1 340px; min-width: 0; }
.gxh-js .gxh-search { display: block; }
.gxh-search svg { position: absolute; left: 13px; top: 13px; width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.gxh-search input { width: 100%; min-height: 44px; font: inherit; font-size: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; padding: 8px 16px 8px 40px; }
.gxh-search input::placeholder { color: var(--text-3); }
.gxh-search input:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.gxh-res { display: block; min-height: 1.2em; margin-top: 6px; padding-left: 16px; font-size: 13px; color: var(--text-3); }

/* section heads */
.gxh-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.gxh-head h2 { margin: 0; scroll-margin-top: 110px; }
.gxh-sub { margin: 8px 0 20px; color: var(--text-2); max-width: 62ch; }
.gxh-more, .gxh-hub { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; color: var(--teal) !important; text-decoration: none !important; }
.gxh-more svg, .gxh-hub svg { width: 16px; height: 16px; transition: transform .2s; }
.gxh-more:hover svg, .gxh-hub:hover svg { transform: translateX(3px); }

/* accents: teal, amber, red in turn */
.gxh .is-teal { --gxa: var(--teal); }
.gxh .is-amber { --gxa: var(--amber); }
.gxh .is-red { --gxa: var(--red); }

/* icon tile, shared by tools and topics */
.gxh-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--gxa); background: color-mix(in srgb, var(--gxa) 14%, transparent); }
.gxh-ico svg { width: 24px; height: 24px; }

/* tools shelf */
.gxh-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.gxh-tool { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 20px 18px 16px; border-radius: 16px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text) !important; text-decoration: none !important; overflow: hidden; transition: transform .2s, border-color .2s, box-shadow .2s; }
.gxh-tool::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--gxa); }
.gxh-tool:hover { transform: translateY(-2px); border-color: var(--gxa); box-shadow: 0 14px 30px -18px color-mix(in srgb, var(--gxa) 70%, transparent); }
.gxh-tool:focus-visible { outline: 2px solid var(--gxa); outline-offset: 2px; }
.gxh-tt { display: grid; gap: 4px; min-width: 0; }
.gxh-tt b { font-size: 16px; line-height: 1.3; font-weight: 600; color: var(--text); }
.gxh-ts { font-size: 14px; line-height: 1.45; color: var(--text-2); }
.gxh-where { margin-top: auto; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.gxh-tool.is-dim { opacity: .35; }
.gxh-tool.is-hit { border-color: var(--gxa); }

/* guides by topic */
.gxh-all { display: none; gap: 8px; }
.gxh-js .gxh-all { display: inline-flex; }
.gxh-all button { min-height: 44px; padding: 0 14px; font: inherit; font-size: 14px; color: var(--text-2); background: transparent; border: 1px solid var(--border-strong); border-radius: 999px; cursor: pointer; }
.gxh-all button:hover { color: var(--text); border-color: var(--teal); }
.gxh-topics { display: grid; gap: 10px; }
.gxh-topic { border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); border-left: 4px solid var(--gxa); }
.gxh-topic > summary, .gxh-defs > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 18px; }
.gxh-topic > summary::-webkit-details-marker, .gxh-defs > summary::-webkit-details-marker { display: none; }
.gxh-topic > summary:focus-visible, .gxh-defs > summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 12px; }
.gxh-topic .gxh-tt { flex: 1 1 auto; }
.gxh-n { flex: none; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.gxh-chev { flex: none; width: 10px; height: 10px; margin: 0 4px 4px 6px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg); transition: transform .2s; }
details[open] > summary .gxh-chev { transform: rotate(-135deg); margin-bottom: -4px; }
.gxh-body { padding: 0 18px 16px 76px; }
.gxh-body ul { list-style: none; margin: 0 0 6px; padding: 0; columns: 2; column-gap: 32px; }
.gxh-body li { break-inside: avoid; margin: 0; padding: 7px 0; border-top: 1px solid var(--border); }
.gxh-body li a { color: var(--text); text-decoration: none; }
.gxh-body li a:hover { color: var(--teal); text-decoration: underline; }
.gxh-body li.is-hit a { color: var(--teal); font-weight: 600; }
.gxh-topic.is-miss { display: none; }

/* definitions drop-down */
.gxh-defs { border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); }
.gxh-defs > summary { justify-content: flex-start; flex-wrap: wrap; }
.gxh-dl { font-weight: 600; color: var(--text); }
.gxh-letters { flex: 1 1 200px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; letter-spacing: .12em; color: var(--text-3); }
.gxh-defs > summary .gxh-chev { margin-left: auto; }
.gxh-defs[open] > summary { border-bottom: 1px solid var(--border); }
.gxh-defs > .gx-controls { position: static; background: transparent; border-bottom: 1px solid var(--border); padding: 14px 18px; margin: 0; }
.gxh-defs .gx-q { font-size: 16px; min-height: 44px; }
.gxh-defs .gx-rail button { min-width: 34px; min-height: 40px; }
.gxh-defs .gx-list { padding: 4px 18px 8px; margin: 0; }
.gxh-defs .gx-empty { padding: 0 18px 16px; }
.gxh .gx-row { scroll-margin-top: 110px; }
.gxh .gx-row.is-target { animation: gxhFlash 1.6s ease; border-radius: 10px; }
@keyframes gxhFlash { 0%, 40% { background: color-mix(in srgb, var(--teal) 16%, transparent); } 100% { background: transparent; } }

@media (max-width: 1000px) { .gxh-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .gxh { gap: 44px; }
  .gxh-quick { margin-top: -12px; }
  .gxh-search { flex: 1 1 100%; }
  .gxh-jump { width: 100%; }
  .gxh-jump a { flex: 1 1 0; justify-content: center; padding: 0 8px; font-size: 13px; }
  .gxh-tools { gap: 10px; }
  .gxh-tool { padding: 16px 14px 12px; gap: 10px; }
  .gxh-tool .gxh-ts { display: none; }
  .gxh-tt b { font-size: 15px; }
  .gxh-topic > summary { padding: 10px 14px; gap: 12px; }
  .gxh-topic .gxh-ts { font-size: 13px; }
  .gxh-n { display: none; }
  .gxh-body { padding: 0 14px 14px; }
  .gxh-body ul { columns: 1; }
  .gxh-letters { display: none; }
}
@media (prefers-reduced-motion: reduce) { .gxh-tool, .gxh-chev, .gxh-more svg, .gxh-hub svg { transition: none; } .gxh .gx-row.is-target { animation: none; } }
@media print { .gxh-quick, .gxh-all { display: none !important; } .gxh details > * { display: block !important; } }
