/* Small atoms — Badge, KBD, Link, Logo, Separator, Skeleton, SkipNav, Tip.
 * Specs: component-specs/{badge,kbd,link,logo,separator,skeleton,skip-nav,tip}.md */

/* ---------- Badge ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    padding-inline: 6px;
    border-radius: 4px;
    font-size: var(--text-micro-size);
    font-weight: var(--font-weight-semibold);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    white-space: nowrap;
}

.badge-version {
    background: var(--action-accent-bg);
    color: var(--action-accent-fg);
}

/* ---------- KBD ---------- */
.kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding-inline: 4px;
    margin: 0;
    border-radius: 4px;
    border: var(--border-hairline) solid var(--border-default);
    background: #30302e;
    color: var(--text-secondary);
    font-family: var(--font-family-sans);
    font-size: var(--text-mini-size);
    font-weight: var(--font-weight-medium);
    box-shadow: none;
}

[data-theme='light'] .kbd {
    background: #e0e0d9;
}

/* ---------- Link ---------- */
.link {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-thickness: var(--underline-thickness);
    text-underline-offset: var(--underline-offset);
    text-decoration-color: var(--text-quaternary);
    transition: text-decoration-color 0.25s;
}

.link:hover {
    text-decoration-color: var(--text-tertiary);
}

.link-dimmed {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.1s;
}

.link-dimmed:hover {
    color: var(--text-primary);
}

.link-external::after {
    content: ' ↗';
}

/* ---------- Logo ---------- */
.logo {
    display: inline-block;
    height: var(--logo-height, 24px);
    width: var(--logo-height, 24px);
    background-color: var(--text-primary);
    -webkit-mask: url('../../assets/tiptree-brand-mark.svg') no-repeat center / contain;
    mask: url('../../assets/tiptree-brand-mark.svg') no-repeat center / contain;
    flex-shrink: 0;
}

/* ---------- Separator ---------- */
.separator {
    border: none;
    flex-shrink: 0;
    background: #262623;
    border-radius: var(--radius-full);
}

[data-theme='light'] .separator {
    background: #e8e8e1;
}

.separator-horizontal {
    width: 100%;
    height: var(--border-hairline);
}

.separator-vertical {
    height: 100%;
    width: var(--border-hairline);
}

/* ---------- Skeleton ---------- */
@keyframes skeleton-pulse {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.skeleton {
    display: block;
    width: 100%;
    background: var(--stone-850);
    animation: skeleton-pulse 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}

[data-theme='light'] .skeleton {
    background: var(--stone-200);
}

.skeleton-text {
    height: 12px;
    border-radius: 4px;
}

.skeleton-block {
    height: 80px;
    border-radius: 8px;
}

/* ---------- SkipNav ---------- */
.skip-nav {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    z-index: var(--z-max);
    border-radius: 8px;
    background: var(--surface-canvas);
    color: var(--text-primary);
    font-size: var(--text-mini-size);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    box-shadow: var(--shadow-md);
}

.skip-nav:focus-visible {
    position: fixed;
    top: 12px;
    left: 12px;
    width: auto;
    height: auto;
    padding: 10px 16px;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ---------- Tip ---------- */
.tip-term {
    position: relative;
    text-decoration: underline dotted var(--text-quaternary);
    text-underline-offset: 3px;
    cursor: help;
}

.tip-bubble {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    z-index: var(--z-popover);
    width: max-content;
    max-width: 280px;
    padding: 8px 10px;
    border: var(--border-hairline) solid var(--border-default);
    border-radius: 8px;
    background: var(--stone-875);
    box-shadow: var(--shadow-md);
    font-size: var(--text-mini-size);
    line-height: var(--text-mini-line-height);
    letter-spacing: var(--text-mini-letter-spacing);
    color: var(--text-secondary);
    text-align: left;
    opacity: 0;
    transform: translate(-50%, 4px);
    transition:
        opacity 0.12s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.12s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

[data-theme='light'] .tip-bubble {
    background: var(--stone-150);
}

.tip-term:hover .tip-bubble,
.tip-term:focus-visible .tip-bubble {
    opacity: 1;
    transform: translate(-50%, 0);
}
