.md_header__social {
    display: none;

    width: 4.3rem;
    max-width: 4.3rem;
}

@media screen and (min-width: 60em) {
    [dir=ltr] .md_header__social {
        margin-left:1rem
    }

    [dir=rtl] .md_header__social {
        margin-right: 1rem
    }

    .md_header__social {
        display: block;
    }
}

@media screen and (min-width: 76.25em) {
    [dir=ltr] .md_header__social {
        margin-left:1.4rem
    }

    [dir=rtl] .md_header__social {
        margin-right: 1.4rem
    }
}

.md_social-custom {
    display: flex;
    align-items: center;

    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    font-size: .65rem;
    line-height: 1.2;
    outline-color: var(--md-accent-fg-color);
    transition: opacity .25s;
    white-space: nowrap;
}

.md_social-custom:hover {
    opacity: 0.7;
}

.md_social-custom__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 2rem;
    width: 2rem;
}

/* Color preview swatches */
.color-swatch {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    vertical-align: middle;
    margin-right: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

[data-md-color-scheme="slate"] .color-swatch {
    border-color: rgba(255, 255, 255, 0.2);
}

.color-swatch-group {
    display: flex;
    gap: 4px;
    align-items: center;
    position: relative;
}

.color-swatch-light,
.color-swatch-dark {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    vertical-align: middle;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    cursor: pointer;
}

[data-md-color-scheme="slate"] .color-swatch-light,
[data-md-color-scheme="slate"] .color-swatch-dark {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Custom tooltip for color swatches */
.color-swatch-light:hover::after,
.color-swatch-dark:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 11px;
    white-space: nowrap;
    border-radius: 4px;
    pointer-events: none;
    z-index: 1000;
    font-family: var(--md-code-font), monospace;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease-out forwards;
}

.color-swatch-light:hover::before,
.color-swatch-dark:hover::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    pointer-events: none;
    z-index: 1001;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease-out forwards;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

[data-md-color-scheme="slate"] .color-swatch-light:hover::after,
[data-md-color-scheme="slate"] .color-swatch-dark:hover::after {
    background-color: rgba(255, 255, 255, 0.95);
    color: rgba(0, 0, 0, 0.9);
}

[data-md-color-scheme="slate"] .color-swatch-light:hover::before,
[data-md-color-scheme="slate"] .color-swatch-dark:hover::before {
    border-top-color: rgba(255, 255, 255, 0.95);
}

/* Ensure table cells don't clip tooltips */
table td {
    overflow: visible !important;
}

/* Vertical center alignment for Name and Preview columns */
table td:first-child,
table td:nth-child(2) {
    vertical-align: middle !important;
}

/* Table section headers */
table td.table-section-header {
    text-align: center !important;
    font-weight: bold;
    background-color: var(--md-default-bg-color--lighter);
    padding: 0.5em 1em;
}

table td.table-section-header strong {
    display: block;
    text-align: center;
}

[data-md-color-scheme="slate"] table td.table-section-header {
    background-color: var(--md-default-bg-color--darker);
}
