.script-editor {
    background:
        linear-gradient(rgb(10 10 10 / 82%), rgb(10 10 10 / 90%)),
        #101010;
}

.script-input::placeholder {
    color: rgb(203 213 225 / 55%);
}

.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    flex: none;
    vertical-align: -0.125em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.page-content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.page-ad-rail {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
}

.page-ad-banner {
    display: flex;
    width: 100%;
    min-height: 5rem;
    align-items: center;
    justify-content: center;
    border: 1px dashed rgb(51 65 85 / 70%);
    border-radius: 1rem;
    background: rgb(15 23 42 / 40%);
    padding: 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
}

.app-preview-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.app-preview-header > div:first-child {
    flex: 1;
}

.app-preview-header > div:last-child {
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .app-preview-header {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }

    .app-preview-header p {
        margin-left: 0;
        margin-right: 0;
    }
}

@media (min-width: 1400px) {
    .page-content-layout {
        max-width: 1400px;
        grid-template-columns: 160px minmax(0, 1fr) 160px;
        justify-content: center;
        gap: 24px;
        margin: 0 auto;
    }

    .page-content-layout > main {
        margin: 0;
    }

    .page-ad-rail {
        align-items: start;
        padding: 3rem 0 0;
    }

    .page-ad-banner {
        position: sticky;
        top: 6rem;
        min-height: 37.5rem;
    }

}

.reading-mode {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    background: #000;
    color: #f8fafc;
}

body.reading-mode-open {
    overflow: hidden;
}

.reading-mode.hidden {
    display: none;
}

.reading-toolbar {
    display: grid;
    grid-template-columns: 3rem 1fr 3rem;
    align-items: center;
    gap: 1rem;
    min-height: 4.5rem;
    padding: max(0.75rem, env(safe-area-inset-top)) 1.25rem 0.75rem;
    border-bottom: 1px solid rgb(255 255 255 / 15%);
}

.reading-title {
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.reading-icon-button {
    display: inline-flex;
    width: 2.75rem;
    height: 2.75rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    color: #e2e8f0;
    font-size: 1.125rem;
}

.reading-icon-button:hover {
    background: rgb(255 255 255 / 10%);
    color: #fff;
}

.reading-teleprompter-box {
    position: relative;
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    text-align: center;
    scrollbar-width: none;
}

.reading-teleprompter-box::-webkit-scrollbar {
    display: none;
}

.reading-text {
    min-height: 100%;
    padding: 32vh 1.5rem 80vh;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-weight: 600;
    line-height: 1.5;
}

.reader-countdown {
    position: absolute;
    z-index: 3;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(0 0 0 / 35%);
    color: #fff;
    font-size: clamp(5rem, 25vw, 12rem);
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 0 2rem rgb(239 68 68 / 55%);
}

.reader-countdown[hidden] {
    display: none;
}

.reading-empty-message {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    color: #64748b;
}

.reading-empty-message[hidden] {
    display: none;
}

.reader-status {
    min-height: 1.25rem;
    padding: 0 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.75rem;
}

.reading-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 3.5rem;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem 1.5rem max(1rem, env(safe-area-inset-bottom));
    border-top: 1px solid rgb(255 255 255 / 15%);
    background: #080808;
}

.reading-slider label {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: #cbd5e1;
    font-size: 0.75rem;
}

.reading-slider output {
    color: #f87171;
}

.reading-play-button {
    display: inline-flex;
    width: 3.25rem;
    height: 3.25rem;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    border-radius: 9999px;
    background: #dc2626;
    color: #fff;
    font-size: 1.125rem;
}

.reading-play-button:hover {
    background: #ef4444;
}

.contact-email-link {
    overflow-wrap: anywhere;
}

.language-selector {
    position: relative;
    display: inline-flex;
    flex: none;
    border: 1px solid #334155;
    border-radius: 0.625rem;
    background: #020617;
}

.language-current {
    min-width: 7rem;
    border: 0;
    border-radius: 0.625rem;
    background: transparent;
    padding: 0.625rem 2rem 0.625rem 0.75rem;
    color: #f1f5f9;
    cursor: pointer;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: left;
}

.language-current::after {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    content: "";
    transform: translateY(-70%) rotate(45deg);
}

.language-current:hover,
.language-current[aria-expanded="true"] {
    background: #1e293b;
}

.language-menu {
    position: absolute;
    z-index: 60;
    top: calc(100% + 0.4rem);
    right: 0;
    display: grid;
    min-width: 9rem;
    gap: 0.125rem;
    padding: 0.25rem;
    border: 1px solid #334155;
    border-radius: 0.625rem;
    background: #0f172a;
    box-shadow: 0 12px 28px rgb(0 0 0 / 35%);
}

.language-menu[hidden] {
    display: none;
}

.language-option {
    width: 100%;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    padding: 0.625rem 0.75rem;
    color: #cbd5e1;
    cursor: pointer;
    font: inherit;
    font-size: 0.875rem;
    text-align: left;
    transition: background-color 150ms ease, color 150ms ease;
}

.language-option:hover {
    color: #fff;
    background: #1e293b;
}

.language-current:focus-visible,
.language-option:focus-visible {
    outline: 2px solid #f87171;
    outline-offset: 2px;
}

.legal-page {
    min-height: 100vh;
    margin: 0;
    background: #020617;
    color: #f1f5f9;
    font: 16px/1.7 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.legal-header {
    position: sticky;
    z-index: 50;
    top: 0;
    border-bottom: 1px solid rgb(30 41 59 / 80%);
    background: rgb(2 6 23 / 90%);
    backdrop-filter: blur(12px);
}

.legal-header-inner {
    display: flex;
    max-width: 56rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

.legal-brand {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.legal-brand:hover {
    color: #f87171;
}

.legal-main {
    width: 100%;
    max-width: 56rem;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

.legal-main h1 {
    margin: 1rem 0 0.375rem;
    color: #fff;
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
}

.legal-main h2 {
    margin: 2rem 0 0.375rem;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
}

.legal-main p {
    margin: 0 0 1rem;
    color: #cbd5e1;
}

.legal-main .sub,
.legal-main .meta {
    color: #94a3b8;
}

.legal-main .meta {
    margin: 0.25rem 0 2rem;
    font-size: 0.875rem;
}

.legal-main a:not(.legal-brand) {
    color: #f87171;
    text-underline-offset: 0.15em;
}

.legal-main a:not(.legal-brand):hover {
    color: #fca5a5;
}

.legal-main a:focus-visible {
    outline: 2px solid #f87171;
    outline-offset: 3px;
    border-radius: 3px;
}

.legal-main .foot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin-top: 3rem;
    padding-top: 1.25rem;
    border-top: 1px solid #1e293b;
    font-size: 0.95rem;
}

.legal-main .foot a:not(:first-child) {
    display: none;
}

.legal-main .foot .back-button,
.legal-main .foot a:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 7rem;
    border-radius: 0.75rem;
    background: #dc2626;
    padding: 0.75rem 1.25rem;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 150ms ease;
}

.legal-main .foot .back-button:hover,
.legal-main .foot a:first-child:hover {
    background: #ef4444;
    color: #fff;
}

@media print {
    .legal-header .language-selector {
        display: none;
    }

    .legal-page {
        background: #fff;
        color: #000;
    }

    .legal-main h1,
    .legal-main h2,
    .legal-main p,
    .legal-main a {
        color: #000 !important;
    }
}

@media (max-width: 520px) {
    .reading-controls {
        grid-template-columns: minmax(0, 1fr) 3.25rem;
        gap: 0.75rem;
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .reading-slider:first-child {
        grid-column: 1;
    }

    .reading-slider:nth-child(2) {
        grid-column: 1;
    }

    .reading-play-button {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .legal-header-inner {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .legal-main {
        padding: 2rem 1rem 3rem;
    }
}

.screenshot-carousel {
    cursor: grab;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.screenshot-carousel:active {
    cursor: grabbing;
}

.screenshot-carousel::-webkit-scrollbar {
    display: none;
}

.screenshot-track,
.screenshot-group {
    display: flex;
    width: max-content;
}

.screenshot-group {
    flex: none;
    gap: 1.5rem;
    padding-right: 1.5rem;
}

@media (prefers-reduced-motion: reduce) {
    .screenshot-carousel {
        scroll-behavior: auto;
    }
}

/* Range input accent custom styling */
input[type="range"] {
    height: 6px;
    border-radius: 5px;
}

/* Keyframe animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}