/* Shared field help (“?”) — linked with shell. See docs/standard-ui-components.md §10. */
/* Shared field help (“?”) — see docs/standard-ui-components.md §10.
 * One pattern for the whole app. Feature chrome may place it; do not invent parallel *-help tooltips. */
.care-label-with-help {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    max-width: 100%;
}

.care-field-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    vertical-align: middle;
}

.care-field-help:hover,
.care-field-help:focus-within {
    z-index: 40;
}

.care-field-help__btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    margin: 0;
    padding: 0;
    border: 1px solid var(--care-app-color-border-subtle);
    border-radius: 999px;
    background: var(--care-app-color-surface-subtle);
    color: var(--care-app-color-ink-muted);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    cursor: help;
}

.care-field-help__btn:hover {
    color: var(--care-app-color-ink-secondary);
    border-color: var(--care-app-color-border-subtle);
    background: var(--care-app-color-surface-elevated);
}

.care-field-help__btn:focus-visible {
    color: var(--care-app-color-ink-secondary);
    border-color: var(--care-app-color-border-subtle);
    background: var(--care-app-color-surface-elevated);
    outline: var(--care-app-focus-ring-width) solid var(--care-app-color-focus-ring);
    outline-offset: var(--care-app-focus-ring-offset);
}

.care-field-help__tooltip {
    position: absolute;
    z-index: 40;
    top: calc(100% + 0.35rem);
    right: 0;
    left: auto;
    width: max-content;
    max-width: 14rem;
    padding: 0.45rem 0.6rem;
    font-size: var(--care-app-type-size-caption);
    font-weight: 400;
    line-height: var(--care-app-type-leading-snug);
    color: var(--care-app-color-ink-primary);
    /* Opaque popover — not surface-raised (translucent in dark theme). */
    background: var(--care-app-color-surface-elevated);
    border: 1px solid var(--care-app-color-border-subtle);
    border-radius: var(--care-app-radius-sm);
    box-shadow: var(--care-app-shadow-floating);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity var(--care-app-motion-duration-interaction) var(--care-app-motion-ease),
        visibility var(--care-app-motion-duration-interaction) var(--care-app-motion-ease);
    text-align: start;
    white-space: normal;
}

/* Placement only — not a second tooltip design. Label rows near the left chrome open into the page. */
.care-label-with-help .care-field-help__tooltip {
    left: 0;
    right: auto;
}

.care-field-help:hover .care-field-help__tooltip,
.care-field-help:focus-within .care-field-help__tooltip,
.care-field-help__btn:focus-visible + .care-field-help__tooltip {
    opacity: 1;
    visibility: visible;
}

/* Never show field-help tips during drag-and-drop (any surface that sets data-care-dragging). */
[data-care-dragging] .care-field-help__tooltip {
    opacity: 0;
    visibility: hidden;
}
