.hg {
  cursor: pointer;
  border-radius: 3px;
}

.hg:hover,
.hg.hg--on {
  background: var(--surface-hi);
}

.hg:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  background: var(--surface-hi);
}

.ht-pop {
  --ht-hi: #F7C948;
  --ht-part: #CFD5E0;
  --ht-dim: #A3ADBE;
  --ht-chip: #1D222B;
  --ht-line: #313946;
  position: fixed;
  z-index: 120;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 0.4375rem;
  max-inline-size: min(21rem, calc(100vw - 16px));
  padding: 0.5625rem 0.75rem;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  line-height: 1.3;
  box-shadow: 0 6px 20px #0005;
}

@media (prefers-color-scheme: dark) {
  .ht-pop {
    --ht-hi: #5E4900;
    --ht-part: #2C3440;
    --ht-dim: #485160;
    --ht-chip: #DFE3EA;
    --ht-line: #C2C8D4;
    box-shadow: 0 6px 20px #0008;
  }
}

@media (prefers-contrast: more) {
  .ht-pop {
    --ht-part: var(--bg);
    --ht-dim: var(--bg);
    --ht-line: var(--bg);
  }
}

.ht-pop[hidden] {
  display: none;
}

.ht-main {
  display: flex;
  flex-direction: column;
  gap: 0.4375rem;
}

.ht-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.125rem 0.5rem;
  padding-block-end: 0.375rem;
  border-block-end: 1px solid var(--ht-line);
  color: var(--ht-hi);
}

.ht-ch {
  font-family: var(--font-ko);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.15;
}

.ht-rom {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
}

.ht-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  font-size: var(--fs-xs);
  color: var(--ht-part);
}

.ht-p,
.ht-parts:not(:has(.ht-p)) {
  display: inline-block;
  border: 1px solid var(--ht-line);
  border-radius: 6px;
  background: var(--ht-chip);
}

.ht-parts:not(:has(.ht-p)) {
  align-self: flex-start;
  padding: 0.1875rem 0.5rem;
  font-weight: 500;
}

.ht-p {
  padding: 0.25rem 0.4375rem;
  line-height: 1.25;
  white-space: nowrap;
}

.ht-r {
  display: block;
  margin-block-end: 0.125rem;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ht-dim);
}

.ht-j {
  font-family: var(--font-ko);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--bg);
}

.ht-note {
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--ht-dim);
}

@media (forced-colors: active) {
  .ht-pop {
    --ht-hi: CanvasText;
    --ht-part: CanvasText;
    --ht-dim: CanvasText;
    --ht-chip: Canvas;
    --ht-line: CanvasText;
    background: Canvas;
    color: CanvasText;
    border: 2px solid CanvasText;
    box-shadow: none;
  }
  .ht-j {
    color: CanvasText;
  }
}

@media print {
  .ht-pop {
    display: none !important;
  }
  .hg {
    background: none !important;
    outline: none !important;
  }
}
