/* Homepage generator and results only */
.generator-shell {
    position: sticky;
    top: 0;
    z-index: 900;
    padding: 12px 16px;
    background: rgba(250, 248, 252, .94);
    border-bottom: 1px solid rgba(233, 223, 234, .9);
    backdrop-filter: blur(14px);
}

.generator-inner {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.generator-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.generator-heading h2 {
    font-size: 1.1rem;
}

.generator-heading p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: .86rem;
}

.style-count {
    color: var(--brand-dark);
    background: var(--brand-soft);
    border-radius: 999px;
    padding: 5px 9px;
    font-size: .8rem;
    font-weight: 750;
    white-space: nowrap;
}

.input-wrap {
    position: relative;
}

#text-box {
    display: block;
    width: 100%;
    min-height: 72px;
    max-height: 160px;
    resize: vertical;
    padding: 15px 92px 15px 15px;
    border: 1.5px solid #d8c9da;
    border-radius: 14px;
    color: var(--text);
    background: #fff;
    font-size: 1.05rem;
    line-height: 1.4;
}

#text-box:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(189, 42, 203, .1);
    outline: 0;
}

.input-actions {
    position: absolute;
    right: 10px;
    top: 10px;
    bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: end;
    justify-content: space-between;
    color: var(--muted);
    font-size: .74rem;
}

.clear {
    border: 0;
    border-radius: 8px;
    padding: 5px 8px;
    background: var(--surface-soft);
    color: var(--brand-dark);
    font-weight: 750;
}

.results-section {
    padding: 54px 0 28px;
}

.result-tools {
    margin-bottom: 22px;
}

.search-box input {
    width: 100%;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 0 14px;
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.search-box input:focus {
    border-color: var(--brand);
    outline: 0;
    box-shadow: 0 0 0 4px rgba(189, 42, 203, .1);
}

.filter-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 2px 4px;
    scrollbar-width: thin;
}

.filter-chip {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    background: var(--surface);
    color: #5d5261;
    font-size: .86rem;
    font-weight: 700;
}

.filter-chip:hover,
.filter-chip.is-active {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.font-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.font-card {
    min-width: 0;
    min-height: 108px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface);
    color: var(--text);
    text-align: left;
    box-shadow: var(--shadow-sm);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.font-card:hover {
    transform: translateY(-2px);
    border-color: #d9b6df;
    box-shadow: var(--shadow-md);
}

.font-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.font-name {
    overflow: hidden;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-label {
    color: var(--brand-dark);
    font-size: .74rem;
    font-weight: 800;
}

.font-output {
    display: block;
    overflow: hidden;
    color: #18141b;
    font-size: 1.15rem;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    padding: 34px;
    border: 1px dashed #cfbfd1;
    border-radius: 14px;
    background: #fff;
    text-align: center;
    color: var(--muted);
}

.font-scroll-sentinel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 54px;
    margin: 22px 0 0;
    color: var(--muted);
    font-size: .84rem;
    font-weight: 700;
    text-align: center;
}

.font-scroll-sentinel[hidden] {
    display: none;
}

.font-scroll-sentinel::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 0 rgba(189, 42, 203, .25);
    animation: fontPulse 1.5s ease-out infinite;
}

@keyframes fontPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(189, 42, 203, .25)
    }

    70% {
        box-shadow: 0 0 0 8px rgba(189, 42, 203, 0)
    }

    100% {
        box-shadow: 0 0 0 0 rgba(189, 42, 203, 0)
    }
}

.preview-card {
    margin: 34px auto 0;
    max-width: 650px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.preview-avatar {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: #fff;
    font-weight: 850;
}

.preview-kicker {
    color: var(--muted);
    font-size: .75rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.preview-content h3 {
    margin: 2px 0 8px;
}

.preview-content p {
    margin: 0 0 8px;
    overflow-wrap: anywhere;
}

.preview-content > span {
    color: var(--muted);
    font-size: .8rem;
}



@media (max-width: 800px) {
    .generator-shell {
        top: 0;
        padding: 8px;
    }

    .generator-inner {
        padding: 10px;
        border-radius: 14px;
    }

    .generator-heading {
        display: none;
    }

    #text-box {
        min-height: 62px;
        padding: 12px 86px 12px 12px;
        font-size: 1rem;
    }

    .font-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .font-card {
        min-height: 96px;
    }
}

@media (max-width: 520px) {
    .ad-container {
        width: min(calc(100% - 22px), var(--max));
    }

    .results-section {
        padding-top: 38px;
    }

    .preview-card {
        grid-template-columns: 44px 1fr;
        padding: 14px;
    }

    .preview-avatar {
        width: 44px;
        height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .font-scroll-sentinel::before {
        animation: none;
    }
}
