.tooltip { z-index: 150; cursor: pointer; pointer-events: auto; border-radius: 0.275rem; background-color: rgb(var(--surface-primary)); padding-top: 0.25rem; padding-bottom: 0.25rem; padding-left: 0.5rem; padding-right: 0.5rem; font-size: 1rem; line-height: 1.5rem; color: rgb(var(--text-primary)); box-shadow: 0 2px 4px 0 rgb(0 0 0 / 0.25); /* Enhanced layout for longer descriptions */ max-width: 320px; word-wrap: break-word; text-align: left; } @media (max-width: 640px) { .tooltip { max-width: 200px; } } .tooltip:where(.dark, .dark *) { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.35); } /* The contrast edge ships with the primitive: the app stylesheet is not part of * the published package, so a consumer importing this file has to get the * boundary too. In a contrast mode the `surface-primary` fill is the canvas * itself, and the black shadow the tooltip otherwise leans on carries no * separation against pure black. */ html.high-contrast .tooltip { border: 1px solid rgb(var(--border-medium)); box-shadow: none; }