.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.listings .listing-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 1200px) {
    .listings .listing-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .listings .listing-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .listings .listing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .listings .listing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.breeds-section .breed-scroll-list {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
}

.home-pets-section .pet-scroll-list {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
}

.home-pets-section .pet-scroll-list .pet-card {
    flex: 0 0 180px;
    max-width: 180px;
    scroll-snap-align: start;
    display: block;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

.home-pets-section .pet-scroll-list .pet-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: #fff;
}

.home-pets-section .pet-card-body {
    padding: 10px;
}

.home-pets-section .pet-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-pets-section .pet-card-meta {
    font-size: 0.78rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-qa-section .qa-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.home-qa-section .qa-panel {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.home-qa-section .qa-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.home-qa-section .qa-panel-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.home-qa-section .qa-panel-icon.recent {
    background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%);
    color: #4f46e5;
}

.home-qa-section .qa-panel-icon.pending {
    background: linear-gradient(135deg, #ffedd5 0%, #fef3c7 100%);
    color: #ea580c;
}

.home-qa-section .qa-panel h3 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.home-qa-section .qa-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.home-qa-section .qa-item {
    display: block;
    width: 100%;
}

.home-qa-section .qa-link {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 14px 13px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    width: 100%;
}

.home-qa-section .qa-link::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #e2e8f0;
    transition: all 0.25s ease;
}

.home-qa-section .qa-panel:first-child .qa-link:hover::before {
    background: #4f46e5;
}

.home-qa-section .qa-panel:last-child .qa-link:hover::before {
    background: #ea580c;
}

.home-qa-section .qa-link:hover {
    background: #fff;
    border-color: #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    transform: translateY(-2px);
}

.home-qa-section .qa-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.home-qa-section .qa-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    background: #e2e8f0;
}

.home-qa-section .qa-user-name {
    font-size: 0.76rem;
    font-weight: 700;
    color: #64748b;
}

.home-qa-section .qa-title {
    font-size: 0.96rem;
    font-weight: 800;
    line-height: 1.35;
    color: #0f172a;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-qa-section .qa-meta {
    font-size: 0.74rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: auto;
}

.home-qa-section .qa-badge {
    padding: 4px 10px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.home-qa-section .qa-badge.category {
    background: #f1f5f9;
    color: #475569;
    border-color: transparent;
}

.home-qa-section .qa-badge.answered {
    background: #ecfdf5;
    color: #059669;
    border-color: #a7f3d0;
}

.home-qa-section .qa-badge.pending {
    background: #fffbeb;
    color: #d97706;
    border-color: #fde68a;
}

.home-qa-section .qa-last-answer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: #94a3b8;
    padding-top: 8px;
    margin-top: 2px;
    border-top: 1px solid #f1f5f9;
}

.home-qa-section .qa-last-answer img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
}

.home-qa-section-hidden {
    display: none !important;
}

@media (max-width: 900px) {
    .home-qa-section .qa-grid {
        grid-template-columns: 1fr;
    }

    .home-qa-section .qa-panel {
        padding: 16px;
    }

    .home-qa-section .qa-link {
        padding: 12px;
    }

    .home-qa-section .qa-last-answer {
        display: none;
    }
}

.breeds-section .breed-scroll-list .breed-card {
    flex: 0 0 180px;
    max-width: 180px;
    scroll-snap-align: start;
}

.breeds-section .breed-scroll-list .breed-card img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
}

.blog-section {
    margin-bottom: 80px;
    clear: both;
}

.popular-filters .filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.popular-filters .filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f2f6ff;
    color: #1d3a8a;
    font-size: 0.85rem;
    text-decoration: none;
    border: 1px solid #dbe6ff;
    transition: all 0.2s ease;
}

.popular-filters .filter-chip:hover {
    background: #e6efff;
    color: #132a66;
}

.story-rail {
    margin: 6px 0 18px;
}

.story-rail-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.story-chip {
    border: 0;
    background: transparent;
    padding: 0;
    width: 84px;
    flex: 0 0 auto;
    text-align: center;
    cursor: pointer;
}

.story-avatar-ring {
    width: 72px;
    height: 72px;
    margin: 0 auto 6px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(45deg, #f97316, #ef4444, #ec4899);
}

.story-chip.is-viewed .story-avatar-ring {
    background: #cbd5e1;
}

.story-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
}

.story-chip-title {
    font-size: 0.75rem;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.82);
    z-index: 1050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.story-modal-overlay.active {
    display: flex;
}

.story-modal-card {
    width: min(420px, 100%);
    background: #0f172a;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    max-height: min(92vh, 860px);
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.35);
}

.story-progress {
    display: flex;
    gap: 5px;
    padding: 10px 12px 0;
    position: relative;
    z-index: 2;
}

.story-progress-bar {
    height: 3px;
    flex: 1;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    overflow: hidden;
}

.story-progress-fill {
    height: 100%;
    width: 0;
    background: #fff;
}

.story-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    padding: 10px 12px;
    position: relative;
    z-index: 2;
}

.story-head-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.story-head-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.story-head-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-close-btn {
    border: 0;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.story-stage {
    position: relative;
    background: #000;
    min-height: 0;
    height: 100%;
    max-height: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

.story-stage img,
.story-stage-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.story-stage-video {
    display: none;
    background: #000;
}

.story-nav-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 35%;
}

.story-nav-zone.prev {
    left: 0;
}

.story-nav-zone.next {
    right: 0;
}

.story-footer {
    color: #fff;
    padding: 12px;
    background: rgba(15, 23, 42, 0.95);
    position: relative;
    z-index: 2;
}

.story-desc {
    font-size: 0.84rem;
    color: #e2e8f0;
    min-height: 34px;
    margin-bottom: 10px;
}

.story-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.story-open-link,
.story-call-link {
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.78rem;
}

.story-imp {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    color: #cbd5e1;
}

@media (max-width: 576px) {
    .story-modal-overlay {
        padding: 8px;
    }

    .story-modal-card {
        width: 100%;
        max-height: 94vh;
        border-radius: 14px;
    }

    .story-head {
        padding: 8px 10px;
    }

    .story-footer {
        padding: 10px;
    }

    .story-desc {
        min-height: 0;
        margin-bottom: 8px;
    }
}

.topic-strip-section {
    padding: 12px 0 4px;
    background: #f5f6f8;
}

.topic-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
}

.topic-strip::-webkit-scrollbar {
    display: none;
}

.topic-chip {
    min-width: 0;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 8px;
    border-radius: 12px;
    border: 1px solid #d7dde5;
    background: #fff;
    color: #23354d;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(18, 35, 62, 0.05);
}

.topic-chip:hover {
    border-color: #bfd0e4;
    box-shadow: 0 8px 20px rgba(18, 35, 62, 0.08);
}

.topic-chip-icon,
.topic-grid-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    overflow: hidden;
    flex: 0 0 auto;
    color: #fff;
}

.topic-chip-icon img,
.topic-grid-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
}

.topic-chip-label,
.topic-grid-label {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.topic-chip-more-card {
    border: 1px solid #cfd8e4;
    padding-right: 10px;
    cursor: pointer;
}

.topic-more-stack {
    position: relative;
    width: 46px;
    height: 34px;
    flex: 0 0 46px;
}

.topic-more-stack-item {
    position: absolute;
    top: 0;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    border: 2px solid #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    overflow: hidden;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.12);
}

.topic-more-stack-item:nth-child(1) {
    left: 0;
    z-index: 3;
}

.topic-more-stack-item:nth-child(2) {
    left: 12px;
    top: 3px;
    z-index: 2;
}

.topic-more-stack-item:nth-child(3) {
    left: 24px;
    top: 6px;
    z-index: 1;
}

.topic-more-stack-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topic-more-count {
    min-width: 32px;
    height: 26px;
    padding: 0 8px;
    margin-left: 2px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    color: #4253c7;
    font-size: 12px;
    font-weight: 800;
}

.topic-panel-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.44);
    z-index: 1090;
}

.topic-panel-overlay.active {
    display: block;
}

.topic-panel {
    display: none;
    position: fixed;
    top: 88px;
    left: 50%;
    width: min(1120px, calc(100vw - 32px));
    max-height: calc(100vh - 112px);
    overflow-y: auto;
    margin-top: 0;
    border: 1px solid #d7dde5;
    border-radius: 20px;
    background: #f6f8fb;
    padding: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    transform: translateX(-50%);
    z-index: 1091;
}

.topic-panel.active {
    display: block;
}

.topic-grid-card:hover {
    border-color: #c1cfdd;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.topic-grid-label {
    white-space: normal;
    line-height: 1.35;
}

.topic-chip-more {
    margin-left: auto;
    cursor: pointer;
}

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

.topic-panel-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #23354d;
}

.topic-panel-actions {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.topic-panel-link,
.topic-panel-close {
    border: 0;
    background: transparent;
    color: #1063d8;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.topic-panel-close {
    color: #27415e;
    font-size: 22px;
    line-height: 1;
}

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

.topic-grid-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #d1d5db;
    background: #fff;
    text-decoration: none;
    color: #23354d;
    min-height: 78px;
}

.topic-grid-card .topic-grid-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.topic-grid-card .topic-grid-label {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    flex: 1 1 auto;
}

@media (min-width: 641px) {
    .topic-strip {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        overflow-x: visible;
        padding-bottom: 0;
    }

    .topic-chip,
    .topic-chip-more-card {
        width: 100%;
        min-width: 0;
    }

    .topic-chip-more-card {
        justify-content: space-between;
    }
}

.home-section-title-green {
    color: #28a745;
}

.home-section-title-red,
.home-section-link-red {
    color: #dc3545;
}

.home-section-title-pink,
.home-section-link-pink {
    color: #e91e63;
}

.listings-lost-section {
    background: #fff0f0;
}

.listing-badge-static {
    position: absolute;
    top: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
}

.listing-badge-static-left {
    left: 8px;
}

.listing-badge-static-right {
    right: 8px;
}

.listing-badge-gray {
    background: #6c757d;
}

.listing-badge-green {
    background: #198754;
}

.listing-badge-red {
    background: #dc3545;
}

.listing-badge-pink {
    background: #e91e63;
}

.listing-date-meta {
    font-size: 0.75rem;
    color: #666;
}

@media (max-width: 640px) {
    .topic-strip-section {
        padding: 10px 0 2px;
    }

    .topic-strip {
        gap: 12px;
        padding: 4px 2px 10px;
        scroll-snap-type: x proximity;
    }

    .topic-chip,
    .topic-chip-more-card {
        width: min(72vw, 176px);
        min-width: min(72vw, 176px);
        padding: 10px 12px 10px 10px;
        border-radius: 16px;
        align-items: center;
        scroll-snap-align: start;
    }

    .topic-chip-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .topic-chip-icon img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .topic-chip-label {
        white-space: normal;
        line-height: 1.3;
        font-size: 14px;
    }

    .topic-chip-more-card {
        justify-content: space-between;
    }

    .topic-panel-overlay.active {
        display: block;
    }

    .topic-panel {
        position: fixed;
        top: calc(10px + env(safe-area-inset-top));
        left: 50%;
        right: auto;
        bottom: auto;
        width: min(100vw - 16px, 560px);
        margin-top: 0;
        border: 0;
        border-radius: 22px;
        background: #f8fafc;
        padding: 16px 14px calc(18px + env(safe-area-inset-bottom));
        box-shadow: 0 -18px 44px rgba(15, 23, 42, 0.18);
        max-height: calc(100vh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        overflow-y: auto;
        transform: translate(-50%, -12px);
        opacity: 0;
        transition: transform 0.24s ease, opacity 0.24s ease;
    }

    .topic-panel.active {
        display: block;
        transform: translate(-50%, 0);
        opacity: 1;
    }

    .topic-panel-header {
        position: sticky;
        top: 0;
        background: #f8fafc;
        padding-bottom: 12px;
        z-index: 2;
    }

    .topic-panel-title {
        font-size: 20px;
    }

    .topic-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .topic-grid-card {
        align-items: center;
        min-height: 112px;
        padding: 12px;
        border-radius: 16px;
        text-align: center;
    }

    .topic-grid-icon {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    .topic-grid-card .topic-grid-label {
        font-size: 14px;
        line-height: 1.35;
        width: 100%;
    }

    .home-pets-section .pet-scroll-list .pet-card {
        flex-basis: 150px;
        max-width: 150px;
    }

    .breeds-section .breed-scroll-list .breed-card {
        flex-basis: 150px;
        max-width: 150px;
    }

    .topic-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .topic-chip-label {
        font-size: 13px;
    }

    .topic-grid-label {
        font-size: 14px;
    }
}

@media (max-width: 991.98px) {
    .topic-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
