.hg-store .hg-tg-switch {
    display: inline-flex;
    gap: 4px;
    margin: 0 0 22px;
    padding: 4px;
    border: 1px solid var(--hg-line);
    border-radius: 999px;
    background: var(--hg-white);
}

.hg-store .hg-tg-switch a {
    display: grid;
    place-items: center;
    min-height: 44px;
    padding: 0 22px;
    border-radius: 999px;
    color: var(--hg-muted);
    font-weight: 700;
    text-decoration: none;
}

.hg-store .hg-tg-switch a[aria-selected="true"] {
    background: var(--hg-ink);
    color: var(--hg-paper);
}

.hg-store .hg-tg-guide a:focus-visible {
    outline: 2px solid var(--hg-red);
    outline-offset: 2px;
}

.hg-store .hg-tg-guide [hidden] { display: none; }
.hg-store .hg-tg-guide :is(.hgg, .hgg-panel) { scroll-margin-top: 8rem; }

.hg-store .hg-tg-guide .hg-tg-example {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    border: 2px dashed var(--hg-line);
    color: var(--hg-muted);
    font-size: 14px;
    font-weight: 700;
}

.hg-store .hg-tg-guide .hg-tg-grade-d .hgg-code {
    justify-self: start;
    padding: 4px 12px 2px;
    border-radius: 10px;
    background: var(--hg-red);
    color: var(--hg-on-accent, #fff);
}

.hg-store .hg-tg-rules {
    margin: 12px 0 0;
    color: var(--hg-muted);
    font-size: .875rem;
}

/* Без JS ссылки ведут к полным описаниям, опубликованным в обычном потоке. */
.hg-store .hg-tg-guide:not(.is-enhanced) .hgg + .hgg { margin-top: 24px; }
.hg-store .hg-tg-guide:not(.is-enhanced) .hgg-scale::before,
.hg-store .hg-tg-guide:not(.is-enhanced) .hgg-mascot,
.hg-store .hg-tg-guide:not(.is-enhanced) .hgg-say::before { display: none; }
.hg-store .hg-tg-guide:not(.is-enhanced) .hgg-panel {
    grid-area: auto;
    visibility: visible;
    padding: 20px 0;
}
.hg-store .hg-tg-guide:not(.is-enhanced) .hgg-panel + .hgg-panel { border-top: 1px solid var(--hg-line); }
.hg-store .hg-tg-guide:not(.is-enhanced) .hgg-voice { display: block; height: auto; min-height: 0; padding: 0; }
.hg-store .hg-tg-guide:not(.is-enhanced) .hgg-say { min-height: 0; }
.hg-store .hg-tg-guide:not(.is-enhanced) .hgg-panel :is(.hgg-photo, .hgg-code, h3, .hgg-detail, .hgg-note, .hgg-say, .hgg-more) {
    opacity: 1;
    transform: none;
}

@media (max-width: 680px) {
    .hg-store .hg-tg-switch { display: flex; }
    .hg-store .hg-tg-switch a { flex: 1; padding-inline: 10px; }
    .hg-store .hg-tg-guide .hgg-tab span { display: none; }
    .hg-store .hg-tg-guide .hgg-tab { min-height: 56px; }
}

/* C660. Короткие подписи не рвутся посреди слова: в JA — по фразам, в EN/RU — по словам. */
.hg-store .hg-tg-guide :is(.hgg-tab span, .hgg-card h3, .hg-tg-photo figcaption, .hgg-say strong, .hgg-more) {
    word-break: keep-all;
    word-break: auto-phrase;
    overflow-wrap: anywhere;
}

/* C660. Широкий экран: реплика справа от маскота занимает и место под фото (до правого края фото),
   растёт вверх от кромки и не поднимается выше фото с подписью; ссылка под репликой остаётся внутри карточки. */
@media (min-width: 1101px) {
    .hg-store .hg-tg-guide .hgg-voice {
        grid-column: 1 / -1;
        height: auto;
        min-height: var(--hgg-fig);
        margin-top: 308px;
        padding-right: calc((100% - 40px) * 7 / 12 - 240px);
        padding-bottom: 24px;
    }
}

/* C660. Панели друг под другом (до 1100 px): высота блока — по открытой панели, без пустоты между описанием и маскотом. */
@media (max-width: 1100px) {
    .hg-store .hg-tg-guide.is-enhanced .hgg-panel:not(.is-active) {
        height: 0;
        overflow: hidden;
    }
}
