.dictionary-page {
    margin-bottom: 2.5rem;
}

.dictionary-page-title {
    text-align: center;
    margin-bottom: 1.75rem;
}

.dictionary-page-title h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.dictionary-index-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    margin: 0 auto 2.5rem;
    max-width: 100%;
    width: fit-content;
}

.dictionary-index-nav a,
.dictionary-index-nav span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.35rem;
    height: 2.35rem;
    padding: 0 0.4rem;
    border: 1px solid #222;
    text-decoration: none;
    color: inherit;
    font-size: 0.95rem;
    line-height: 1;
    background: #fff;
    box-sizing: border-box;
}

.dictionary-index-nav a.dictionary-nav-all {
    min-width: auto;
    padding: 0 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.dictionary-index-nav a:hover {
    background: #f5f5f5;
}

.dictionary-index-nav a.active {
    background: #222;
    color: #fff;
}

.dictionary-index-nav span.disabled {
    opacity: 0.35;
    cursor: default;
    user-select: none;
}

.dictionary-index-nav .is-nav-hidden {
    display: none !important;
}

.dictionary-groups-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2.5rem 3rem;
    align-items: start;
}

.dictionary-groups-grid.is-single-group {
    grid-template-columns: minmax(0, 1fr);
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
}

.dictionary-group {
    min-width: 0;
}

.dictionary-group.is-filtered-out {
    display: none;
}

.dictionary-group-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.65rem;
    line-height: 1.2;
}

.dictionary-term-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dictionary-term-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem 0.55rem;
    margin-bottom: 0.2rem;
    line-height: 1.45;
}

.dictionary-term-views {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--fd-muted, #666);
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
}

.dictionary-term-list a {
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

.dictionary-term-list a:hover {
    text-decoration-thickness: 2px;
}

.dictionary-term-detail .short-definition {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #555;
}

.dictionary-related-terms {
    margin-top: 2rem;
}

.dictionary-empty {
    text-align: center;
    color: #666;
    margin: 2rem 0;
}

@media (max-width: 1200px) {
    .dictionary-groups-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 2rem 2.5rem;
    }
}

@media (max-width: 900px) {
    .dictionary-groups-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem;
    }
}

@media (max-width: 600px) {
    .dictionary-groups-grid {
        grid-template-columns: 1fr;
    }

    .dictionary-index-nav {
        width: 100%;
    }

    .dictionary-index-nav a,
    .dictionary-index-nav span {
        flex: 1 0 auto;
        min-width: 2rem;
    }

    .dictionary-index-nav a.dictionary-nav-all {
        flex: 1 0 100%;
    }
}
