.glyph-browser,
.glyph-symbol-page {
    --glyph-border: rgb(216 255 200 / 15%);
    --glyph-muted: #a89070;
    --glyph-panel: rgb(0 255 43 / 8%);
    --glyph-panel-hover: rgba(127, 127, 127, .14);
    --glyph-radius: 16px;
    position: relative;
}

.glyph-browser__header {
    margin-bottom: 1.25rem;
}

.glyph-browser__header h1,
.glyph-symbol-page h1 {
    margin-bottom: .45rem;
}

.glyph-browser__header p {
    margin: 0;
    max-width: 70rem;
}

.glyph-browser__search {
    margin: 1.25rem 0;
}

.glyph-browser__search-label {
    display: block;
    margin-bottom: .4rem;
    font-weight: 600;
}

.glyph-browser__search-row {
    display: flex;
    gap: .5rem;
}

.glyph-browser__search-row input {
    min-width: 0;
    flex: 1;
    padding: .75rem .9rem;
    border: 1px solid var(--glyph-border);
    border-radius: 9px;
    font: inherit;
    color: inherit;
    background: transparent;
}

.glyph-browser__search-row button,
.glyph-card__copy {
    border: 1px solid var(--glyph-border);
    border-radius: 9px;
    padding: .65rem .8rem;
    color: inherit;
    background: var(--glyph-panel);
    cursor: pointer;
}

.glyph-browser__search-row button:hover,
.glyph-card__copy:hover {
    background: var(--glyph-panel-hover);
}

.glyph-browser__groups {
    display: flex;
    gap: .45rem;
    overflow-x: auto;
    padding: .15rem 0 .65rem;
}

.glyph-browser__group {
    flex: 0 0 auto;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--glyph-border);
    border-radius: 999px;
    padding: .5rem .75rem;
    background: transparent;
}

.glyph-browser__group span {
    opacity: .65;
    margin-left: .25rem;
}

.glyph-browser__group.is-active {
    background: var(--glyph-panel-hover);
    font-weight: 600;
}

.glyph-browser__summary {
    margin: .6rem 0 1rem;
}

.glyph-browser__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: .7rem;
}

.glyph-card {
    min-width: 0;
    border: 1px solid var(--glyph-border);
    border-radius: var(--glyph-radius);
    background: var(--glyph-panel);
    overflow: hidden;
}

.glyph-card:hover {
    background: var(--glyph-panel-hover);
}

.glyph-card__main {
    display: flex;
    min-height: 120px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .85rem .65rem .6rem;
    color: inherit;
    text-decoration: none;
    text-align: center;
}

.glyph-card__sprite-wrap {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glyph-sprite {
    display: inline-block;
    flex: 0 0 auto;
    background-repeat: no-repeat;
    image-rendering: pixelated;
}

.glyph-card__name {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.2;
    font-size: .92rem;
}

.glyph-card__code {
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .78rem;
}

.glyph-card__copy {
    display: block;
    width: calc(100% - 1rem);
    margin: 0 .5rem .5rem;
    font-size: .82rem;
}

.glyph-browser__empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--glyph-muted);
}

.glyph-toast {
    position: fixed;
    z-index: 10000;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    max-width: min(90vw, 420px);
    padding: .7rem 1rem;
    border-radius: 10px;
    background: #222;
    color: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
}

.glyph-symbol-page__back {
    display: inline-block;
    margin-bottom: 1rem;
}

.glyph-symbol-page__header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.glyph-symbol-page__hero {
    display: grid;
    place-items: center;
    min-width: 96px;
    min-height: 96px;
    border: 1px solid var(--glyph-border);
    border-radius: var(--glyph-radius);
    background: var(--glyph-panel);
}

.glyph-symbol-page__unicode {
    color: var(--glyph-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.glyph-symbol-page__copy {
    width: auto;
    margin: .5rem 0 0;
}

.glyph-symbol-page__details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .75rem;
    margin: 0 0 2rem;
}

.glyph-symbol-page__details div,
.glyph-symbol-page__variant {
    padding: .8rem;
    border: 1px solid var(--glyph-border);
    border-radius: var(--glyph-radius);
    background: var(--glyph-panel);
}

.glyph-symbol-page__details dt {
    color: var(--glyph-muted);
    font-size: .8rem;
}

.glyph-symbol-page__details dd {
    margin: .3rem 0 0;
    font-weight: 600;
}

.glyph-symbol-page__variant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .75rem;
}

.glyph-symbol-page__variant {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 1rem;
}

.glyph-symbol-page__variant code {
    overflow-wrap: anywhere;
    font-size: .75rem;
}

@media (max-width: 600px) {
    .glyph-browser__search-row {
        align-items: stretch;
        flex-direction: column;
    }

    .glyph-browser__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .glyph-symbol-page__header {
        align-items: flex-start;
        flex-direction: column;
    }
}

.glyph-browser {
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.glyph-browser__collections,
.glyph-browser__categories,
.glyph-browser__subcategories {
    display: flex;
    flex-flow: row nowrap;

    width: 100%;
    max-width: 100%;
    min-width: 0;

    gap: .45rem;

    overflow-x: auto;
    overflow-y: hidden;

    padding: .15rem 0 .65rem;

    scrollbar-width: thin;
    scroll-snap-type: x proximity;
}

.glyph-browser__collection,
.glyph-browser__category,
.glyph-browser__subcategory {
    display: flex;
    flex: 0 0 auto;

    align-items: center;
    gap: .25rem;

    padding: .5rem .75rem;

    color: inherit;
    background: transparent;

    border: 1px solid var(--glyph-border);
    border-radius: 999px;

    text-decoration: none;
    white-space: nowrap;

    scroll-snap-align: start;
}

.glyph-browser__collection span,
.glyph-browser__category span,
.glyph-browser__subcategory span {
    margin-left: .25rem;
    opacity: .65;
}

.glyph-browser__collection.is-active,
.glyph-browser__category.is-active,
.glyph-browser__subcategory.is-active {
    background: var(--glyph-panel-hover);
    font-weight: 600;
}

.glyph-browser__collections::-webkit-scrollbar-thumb,
.glyph-browser__categories::-webkit-scrollbar-thumb,
.glyph-browser__subcategories::-webkit-scrollbar-thumb {
    border-radius: 999px;
}

.glyph-browser__collections,
.glyph-browser__categories,
.glyph-browser__subcategories {
    display: flex;
    flex-flow: row nowrap;
    gap: .45rem;

    width: 100%;
    min-width: 0;
    max-width: 100%;

    overflow-x: auto;
    overflow-y: hidden;

    padding: .15rem 0 .65rem;

    scroll-snap-type: x proximity;
    scroll-behavior: smooth;

    /* Firefox */
    scrollbar-width: none;

    /* Старые Edge/IE */
    -ms-overflow-style: none;

    -webkit-overflow-scrolling: touch;
}

/* Chrome / Edge / Safari */
.glyph-browser__collections::-webkit-scrollbar,
.glyph-browser__categories::-webkit-scrollbar,
.glyph-browser__subcategories::-webkit-scrollbar {
    display: none;
}
.glyph-scroll {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 6px;

    width: 100%;
    max-width: 100%;
    min-width: 0;

    overflow: hidden;
    box-sizing: border-box;
}

.glyph-browser__collections,
.glyph-browser__categories,
.glyph-browser__subcategories {
    display: flex;
    flex-flow: row nowrap;
    gap: .45rem;

    width: 100%;
    max-width: 100%;
    min-width: 0;

    overflow-x: auto;
    overflow-y: hidden;

    padding: .15rem 0 .65rem;

    box-sizing: border-box;

    scroll-behavior: smooth;
    scroll-snap-type: x proximity;

    scrollbar-width: none;
    -ms-overflow-style: none;

    -webkit-overflow-scrolling: touch;
}

.glyph-browser__collections::-webkit-scrollbar,
.glyph-browser__categories::-webkit-scrollbar,
.glyph-browser__subcategories::-webkit-scrollbar {
    display: none;
}

.glyph-scroll__button {
    position: static;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;

    padding: 0;

    border: 1px solid var(--glyph-border);
    border-radius: 50%;

    background: var(--glyph-panel);
    color: inherit;

    font: inherit;
    font-size: 26px;
    line-height: 1;

    cursor: pointer;

    transform: none;
}

.glyph-scroll__button:hover {
    background: var(--glyph-panel-hover);
}

.glyph-scroll__button:disabled {
    opacity: .25;
    cursor: default;
}

/* старые absolute-позиции больше НЕ нужны */
.glyph-scroll__button--left,
.glyph-scroll__button--right {
    left: auto;
    right: auto;
}


/* На телефоне стрелки убираем,
   а скроллер занимает всю ширину */
@media (hover: none), (pointer: coarse) {
    .glyph-scroll {
        grid-template-columns: minmax(0, 1fr);
    }

    .glyph-scroll__button {
        display: none;
    }
}

/* Телефон — просто свайпаем пальцем */
@media (hover: none), (pointer: coarse) {
    .glyph-scroll__button {
        display: none;
    }

    .glyph-browser__collections,
    .glyph-browser__categories,
    .glyph-browser__subcategories {
        padding-inline: 0;
    }
}