.hslg-grid {
    --hslg-columns: 4;
    --hslg-rows: 3;
    display: grid;
    grid-template-columns: repeat(var(--hslg-columns), minmax(0, 1fr));
    width: 100%;
    column-gap: 24px;
    row-gap: 18px;
    overflow: visible;
}

.hslg-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 140px;
    padding: 18px;
    overflow: visible;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    perspective: 900px;
}

.hslg-cell.hslg-is-animating {
    z-index: 20;
}

.hslg-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: visible;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.hslg-logo-link--disabled {
    pointer-events: none;
    cursor: default;
}

.hslg-logo-link:not(.hslg-logo-link--disabled) {
    cursor: pointer;
}

.hslg-logo {
    display: block;
    width: auto;
    height: auto;
    max-width: 78%;
    max-height: 70px;
    object-fit: contain;
    object-position: center;
    margin: auto;
    position: relative;
    z-index: 1;
    transform-origin: center center;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform, opacity, filter;
}

.hslg-logo-next {
    position: absolute !important;
    left: 50%;
    top: 50%;
    margin: 0 !important;
    z-index: 3;
    pointer-events: none;
}

.hslg-empty {
    padding: 16px;
    border: 1px dashed currentColor;
    opacity: .7;
}

@media (prefers-reduced-motion: reduce) {
    .hslg-logo {
        animation: none !important;
        transition: none !important;
    }
}

/* =========================================
   Frontend animation tester (presentation)
========================================= */
.hslg-instance {
    position: relative;
}

.hslg-demo-toggle,
.hslg-demo-panel {
    --hslg-demo-edge: 22px;
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.hslg-demo-position--bottom_right {
    right: var(--hslg-demo-edge);
    bottom: var(--hslg-demo-edge);
}

.hslg-demo-position--bottom_left {
    left: var(--hslg-demo-edge);
    bottom: var(--hslg-demo-edge);
}

.hslg-demo-position--top_right {
    right: var(--hslg-demo-edge);
    top: var(--hslg-demo-edge);
}

.hslg-demo-position--top_left {
    left: var(--hslg-demo-edge);
    top: var(--hslg-demo-edge);
}

.hslg-demo-toggle {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 15px;
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 999px;
    background: rgba(255, 255, 255, .96);
    color: #161616;
    box-shadow: 0 10px 35px rgba(0, 0, 0, .13);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: 13px;
    font-weight: 650;
    line-height: 1;
    cursor: pointer;
    transition: transform .2s ease, opacity .2s ease, box-shadow .2s ease;
}

.hslg-demo-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .17);
}

.hslg-demo-toggle.is-hidden {
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px) scale(.96);
}

.hslg-demo-toggle-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, .06);
}

.hslg-demo-panel {
    width: min(350px, calc(100vw - 32px));
    padding: 0;
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 18px;
    background: rgba(255, 255, 255, .97);
    color: #171717;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .2);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px) scale(.97);
    transform-origin: bottom right;
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
    overflow: hidden;
}

.hslg-demo-panel.hslg-demo-position--top_right,
.hslg-demo-panel.hslg-demo-position--top_left {
    transform: translateY(-12px) scale(.97);
    transform-origin: top right;
}

.hslg-demo-panel.hslg-demo-position--top_left,
.hslg-demo-panel.hslg-demo-position--bottom_left {
    transform-origin: left center;
}

.hslg-demo-panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.hslg-demo-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 18px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, .07);
}

.hslg-demo-head strong,
.hslg-demo-head small {
    display: block;
}

.hslg-demo-head strong {
    margin: 0 0 3px;
    font-size: 14px;
    line-height: 1.25;
}

.hslg-demo-head small {
    color: rgba(0, 0, 0, .52);
    font-size: 11px;
    line-height: 1.35;
}

.hslg-demo-close {
    appearance: none;
    width: 29px;
    height: 29px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 29px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .055);
    color: #222;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
}

.hslg-demo-fields {
    display: grid;
    gap: 13px;
    padding: 16px 18px;
}

.hslg-demo-two-col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
}

.hslg-demo-field {
    display: grid;
    gap: 6px;
    margin: 0;
    color: #222;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.2;
}

.hslg-demo-field[hidden] {
    display: none !important;
}

.hslg-demo-field > span {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.hslg-demo-field select {
    width: 100%;
    min-height: 38px;
    padding: 0 34px 0 11px;
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 9px;
    outline: none;
    background-color: #fff;
    color: #181818;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.hslg-demo-field select:focus {
    border-color: rgba(0, 0, 0, .35);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .05);
}

.hslg-demo-range output {
    color: rgba(0, 0, 0, .55);
    font-size: 11px;
    font-weight: 500;
}

.hslg-demo-range input[type="range"] {
    width: 100%;
    margin: 2px 0 0;
    accent-color: #171717;
    cursor: pointer;
}

.hslg-demo-actions {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr;
    gap: 7px;
    padding: 12px 18px 17px;
    border-top: 1px solid rgba(0, 0, 0, .07);
}

.hslg-demo-actions button {
    appearance: none;
    min-height: 36px;
    padding: 8px 9px;
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 9px;
    background: #fff;
    color: #202020;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.2;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease;
}

.hslg-demo-actions button:hover {
    transform: translateY(-1px);
    background: #f5f5f5;
}

.hslg-demo-actions .hslg-demo-primary {
    border-color: #171717;
    background: #171717;
    color: #fff;
}

.hslg-demo-actions .hslg-demo-primary:hover {
    background: #2a2a2a;
}

@media (max-width: 600px) {
    .hslg-demo-toggle,
    .hslg-demo-panel {
        --hslg-demo-edge: 12px;
    }

    .hslg-demo-panel {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
        overflow-y: auto;
    }

    .hslg-demo-panel.hslg-demo-position--top_right,
    .hslg-demo-panel.hslg-demo-position--top_left {
        top: 12px;
        bottom: auto;
    }

    .hslg-demo-two-col {
        grid-template-columns: 1fr 1fr;
    }
}
