/* Стек кластеров, догружаемые разделы и карточки похожести.
   Часть v3/word-card.css; порядок частей важен — см. static/README.md. */
[data-word-cluster-stack] > [data-word-cluster-section],
[data-word-cluster-stack] > [data-word-async-target] > [data-word-cluster-section],
[data-word-shared-stack] > [data-word-section],
[data-word-shared-stack] > [data-word-async-target] > [data-word-section] {
    margin: 0;
}

[data-word-cluster-stack] > [data-word-async-target],
[data-word-shared-stack] > [data-word-async-target],
[data-word-async-target] {
    display: grid;
    gap: 0;
}

[data-word-async-target].app-shell__section > .section-head {
    margin: 0;
    padding: calc(var(--content-panel-shell-padding-y) + var(--content-panel-shell-head-top-offset, clamp(2px, 0.35vw, 4px)))
             var(--content-panel-shell-padding-x) 0;
    --section-head-padding-x: 0;
    --section-head-padding-y: 0;
    --section-head-text-padding-y: 0;
}

[data-word-async-target].app-shell__section.content-container--panel-shell.surface--quiet:is([data-word-cluster-section], [data-word-shared-section], [data-word-entry-section]) {
    --surface-quiet-radius: var(--surface-radius);
    --surface-quiet-border: var(--container-border-section);
    --surface-quiet-bg: var(--container-surface-section);
    --surface-quiet-backdrop: none;
}

[data-word-async-target].app-shell__section > .content-container--panel-shell.surface--quiet:is([data-word-cluster-section], [data-word-shared-section]) {
    --surface-quiet-radius: var(--surface-radius);
    --surface-quiet-border: var(--container-border-section);
    --surface-quiet-bg: var(--container-surface-section);
    --surface-quiet-backdrop: none;
}

[data-word-async-target].app-shell__section > .section-head + .content-body {
    padding-top: var(--content-panel-shell-body-padding-top);
}

[data-word-async-target].app-shell__section > .section-head + .content-container--panel-shell > .content-body {
    padding-top: var(--content-panel-shell-body-padding-top);
}

[data-word-async-target].app-shell__section > .section-head .section-head__inner {
    min-height: auto;
    align-items: center;
}

[data-word-async-target].app-shell__section > .section-head .section-head__text,
[data-word-async-target].app-shell__section > .section-head .section-head__right {
    align-self: center;
}

[data-word-async-target].app-shell__section > .section-head .section-head__right {
    align-items: center;
}

:is([data-word-cluster-section], [data-word-shared-section]) > .section-head .section-head__inner {
    min-height: auto;
    align-items: center;
}

:is([data-word-cluster-section], [data-word-shared-section]) > .section-head .section-head__text,
:is([data-word-cluster-section], [data-word-shared-section]) > .section-head .section-head__right {
    align-self: center;
}

:is([data-word-cluster-section], [data-word-shared-section]) > .section-head .section-head__right {
    align-items: center;
}

[data-word-cluster-section] [data-section-head-context].badge {
    --badge-min-height: 22px;
    --badge-padding: 2px 7px;
    --badge-border: 1px solid color-mix(in srgb, var(--theme-border-normal) 78%, transparent);
    --badge-bg: color-mix(in srgb, var(--theme-surface-base) 68%, var(--theme-surface-subtle));
    --badge-color: var(--theme-text-muted);
    --badge-font-size: var(--font-size-xs);
    --badge-line-height: var(--type-label-line);
    --badge-letter-spacing: 0;
    --badge-text-transform: none;
}

[data-word-section="forms"] > .section-head .section-head__inner,
[data-word-section="forms"] > .section-head .section-head__right {
    align-items: center;
}

[data-word-async-target].app-shell__section[data-word-section="forms"] > .section-head .section-head__inner,
[data-word-async-target].app-shell__section[data-word-section="forms"] > .section-head .section-head__right {
    align-items: center;
}

[data-word-section] > .content-body {
    gap: var(--inner-gap);
}

[data-word-section] .content-footer--progress {
    margin-top: var(--space-4);
}

[data-word-async-placeholder] {
    overflow: hidden;
}

[data-word-async-body] {
    display: grid;
    gap: var(--control-gap-base);
    padding: var(--control-padding-2xs) 0 0;
}

@keyframes async-line-shimmer {
    from { transform: translateX(-200%); }
    to   { transform: translateX(200%); }
}

[data-word-async-line] {
    display: block;
    position: relative;
    height: 12px;
    border-radius: var(--button-radius-unified);
    background: color-mix(in srgb, var(--theme-border-subtle) 55%, var(--theme-surface-base));
    overflow: hidden;
}

[data-word-async-line]::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        100deg,
        transparent 20%,
        var(--skeleton-shimmer-color) 50%,
        transparent 80%
    );
    animation: async-line-shimmer 1.5s linear infinite;
}

[data-word-async-line="lg"] {
    width: min(68%, 420px);
}

[data-word-async-line="md"] {
    width: min(48%, 300px);
}

[data-word-async-line="full"] {
    width: 100%;
}

[data-word-async-line="sm"] {
    width: min(38%, 220px);
}

[data-word-async-body] [data-word-async-line] {
    height: 14px;
}

.content-card {
    display: grid;
    gap: 6px;
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    border: 0;
    border-radius: 0;
    background: var(--sidebar-ladder-section-bg, var(--theme-surface-subsection));
    box-sizing: border-box;
}

.content-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    margin: 0;
}

.content-card__body,
.content-card__secondary {
    min-width: 0;
}

.content-card__controls {
    width: 100%;
    justify-content: flex-end;
}

[data-word-section] .list-shell.list-shell--columns-2 {
    --list-shell-gap: 12px;
    margin-top: 0;
}

@media (min-width: 860px) {
    [data-word-section] .list-shell.list-shell--columns-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

[data-word-section] .list-shell.list-shell--columns-2 > li {
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
}

[data-word-section] .list-shell.list-shell--columns-2 > li:last-child {
    margin-bottom: 0;
}

.content-group {
    display: grid;
    gap: 10px;
}

.content-group__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.content-group__head > .text-meta {
    margin: 0;
    --text-meta-weight: 400;
}

[data-word-section="semantic-context"] [data-example-list] > li {
    width: 100%;
}

[data-word-section="semantic-context"] [data-word-action-strip="example"] {
    opacity: 1;
    pointer-events: auto;
}

/* Compact one-line layout for semantic similarity cards (title + score badge inline) */
[data-word-section*="semantic"] .result-card__body {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 8px;
    row-gap: 2px;
}

[data-word-section*="semantic"] .result-card__header {
    flex: 1 1 auto;
    min-width: 0;
}

[data-word-section*="semantic"] .result-card__signals {
    flex: 0 0 auto;
}

[data-word-section*="semantic"] .result-card__summary {
    flex-basis: 100%;
    font-size: var(--font-size-xs);
}
