/* ===========================
   SHARE DROPDOWN — [tbm_share]
   Square corners · matches the loop filter dropdown
   =========================== */

.tbms,
.tbms *,
.tbms *::before,
.tbms *::after {
    box-sizing: border-box;
    border-radius: 0 !important;
}

.tbms {
    position: relative;
    z-index: 30;
    display: inline-flex;
    vertical-align: middle;
}

/* ---------- Icon ---------- */

.tbms .tbms__trigger {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #555555 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: color 0.2s ease !important;
}

.tbms .tbms__trigger:hover,
.tbms.is-open .tbms__trigger {
    color: #000000 !important;
}

.tbms .tbms__trigger:focus {
    outline: none !important;
}

.tbms .tbms__trigger:focus-visible {
    outline: 2px solid #000000 !important;
    outline-offset: 2px !important;
}

.tbms__trigger svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* ---------- Panel ---------- */

.tbms__panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 40;
    min-width: 180px;
    margin: 0 !important;
    padding: 6px !important;
    list-style: none !important;
    background: #ffffff;
    border: 1px solid #E0E0E0;
    box-shadow: 0 16px 36px -14px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease,
                transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1),
                visibility 0s linear 0.25s;
}

/* Invisible bridge over the gap, so moving the mouse down doesn't close it */
.tbms__panel::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 8px;
}

.tbms.is-right .tbms__panel {
    left: auto;
    right: 0;
}

/* Opens upward ([tbm_share open="up"], or open="auto" near the bottom) */
.tbms.is-up .tbms__panel {
    top: auto;
    bottom: calc(100% + 6px);
    box-shadow: 0 -16px 36px -14px rgba(0, 0, 0, 0.18);
    transform: translateY(6px);
}

.tbms.is-up .tbms__panel::before {
    top: 100%;
    bottom: auto;
}

.tbms.is-up.is-open .tbms__panel {
    transform: none;
}

.tbms.is-open .tbms__panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s;
}

.tbms__panel li {
    position: relative;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.tbms__panel li + li {
    margin-top: 2px !important;
}

/* ---------- Items ---------- */

.tbms .tbms__item {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    width: 100% !important;
    height: 44px !important;
    margin: 0 !important;
    padding: 0 14px !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    text-transform: none !important;
    text-decoration: none !important;
    white-space: nowrap;
    color: #111111 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease !important;
}

.tbms .tbms__item:hover,
.tbms .tbms__item:focus-visible {
    color: #000000 !important;
    background: #F2F2F2 !important;
    outline: none !important;
}

.tbms__item svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Outline icons (Copy Link) */
.tbms__item svg[stroke] {
    fill: none;
    stroke: currentColor;
}

/* ---------- "Link copied" tooltip ---------- */

.tbms__tip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    z-index: 2;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    color: #ffffff;
    background: #000000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.tbms__tip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: #000000;
}

.tbms__tip.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition-delay: 0s;
}

/* Screen-reader announcement */
.tbms__status {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
    .tbms__panel,
    .tbms__tip {
        transition-duration: 0.01ms !important;
    }
}