.sc-host {
    --carousel-height: 40px;
    position: relative;
    width: 100%;
    height: var(--carousel-height);
    transition: height 500ms ease;
    overflow: hidden;
    user-select: none;
    touch-action: pan-y;
    background: transparent;
    border-radius: 8px;
}

.sc-outlined {
    border: 1px solid rgba(0,0,0,0.12);
}

.sc-viewport {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.sc-track {
    height: 100%;
    display: flex;
    transition: transform 300ms ease;
    will-change: transform;
}

.sc-slide {
    flex: 0 0 100%;
    height: 100%;
    display: flex;
}

.sc-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.sc-arrow {
    position: absolute;
    top: 0;
    bottom: 0;
    border: 0;
    width: 48px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: opacity 200ms ease;
    z-index: 1;
}

.sc-arrow::after {
    content: '';
    position: absolute;
    inset: 0;
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    mask-image: linear-gradient(to var(--arrow-dir), transparent 0%, black 30%);
    -webkit-mask-image: linear-gradient(to var(--arrow-dir), transparent 0%, black 30%);
    pointer-events: none;
}

.sc-arrow::before {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    z-index: 1;
}

.sc-left {
    --arrow-dir: left;
    left: 0;
    border-radius: 8px 0 0 8px;
}

.sc-left::before {
    transform: rotate(-45deg);
    margin-left: 4px;
}

.sc-right {
    --arrow-dir: right;
    right: 0;
    border-radius: 0 8px 8px 0;
}

.sc-right::before {
    transform: rotate(135deg);
    margin-right: 4px;
}

.sc-bullets {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    align-items: center;
}

.sc-bullet {
    width: 8px;
    height: 8px;
    border-radius: 20px;
    border: 0;
    cursor: pointer;
    background: rgba(255,255,255,0.55);
}

.sc-bullet.is-active {
    background: rgba(255,255,255,0.95);
}

/* --- Modal --- */

.sc-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 80px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease;
}

.sc-modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.sc-modal-overlay .sc-host {
    max-width: 900px;
    max-height: calc(100vh - 48px);
    border-radius: 12px;
    background: #000;
    overflow: visible;
}

.sc-modal-overlay .sc-viewport {
    overflow: hidden;
    border-radius: 12px;
}

.sc-modal-overlay .sc-host .sc-img {
    object-fit: cover;
}

.sc-modal-overlay .sc-outlined {
    border-color: rgba(255, 255, 255, 0.15);
}

/* Modal arrows: outside the image */
.sc-modal-overlay .sc-arrow {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: background 200ms ease;
}

.sc-modal-overlay .sc-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sc-modal-overlay .sc-arrow::after {
    display: none;
}

.sc-modal-overlay .sc-left {
    left: -60px;
    border-radius: 50%;
}

.sc-modal-overlay .sc-right {
    right: -60px;
    border-radius: 50%;
}

.sc-modal-overlay .sc-left::before {
    margin-left: 3px;
}

.sc-modal-overlay .sc-right::before {
    margin-right: 3px;
}

/* --- Demo --- */

.demo-wrapper {
    max-width: 640px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.demo-wrapper h1 {
    font-family: system-ui, sans-serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.demo-wrapper .sc-host {
    cursor: pointer;
}