/* Типографика, сегментированный переключатель, значки, триггеры состояния.
   Часть v3/core.css; порядок частей важен — см. static/README.md. */
h1,
h1.text-title {
    font-size: var(--type-h1-size);
    line-height: var(--type-h1-line);
    font-weight: var(--type-h1-weight);
    letter-spacing: var(--hierarchy-heading-track);
}

h2,
h2.text-title {
    font-size: var(--type-h2-size);
    line-height: var(--type-h2-line);
    font-weight: var(--type-h2-weight);
    letter-spacing: var(--hierarchy-heading-track);
}

h3,
h3.text-title {
    font-size: var(--type-h3-size);
    line-height: var(--type-h3-line);
    font-weight: var(--type-h3-weight);
    letter-spacing: var(--hierarchy-heading-track);
}

h4,
h4.text-title {
    font-size: var(--type-h4-size);
    line-height: var(--type-h4-line);
    font-weight: var(--type-h4-weight);
    letter-spacing: var(--hierarchy-heading-track);
}

h5,
h5.text-title {
    font-size: var(--type-h5-size);
    line-height: var(--type-h5-line);
    font-weight: var(--type-h5-weight);
    letter-spacing: var(--hierarchy-heading-track);
}

h6,
h6.text-title {
    font-size: var(--type-h6-size);
    line-height: var(--type-h6-line);
    font-weight: var(--type-h6-weight);
    letter-spacing: var(--hierarchy-heading-track);
}

.text-title,
.text-heading,
.audio-word-link,
.media-card-title,
.media-player-title,
.text-meta,
.media-card-author,
.media-player-author,
.audio-word-equivalents,
.text-summary,
.media-card-desc,
.media-player-description,
.text-hint {
    margin: 0;
    min-width: 0;
}

.media-card-title,
.media-card-desc {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.segmented-control {
    --selection-control-transition-duration: 180ms;
    --selection-control-transition-ease: var(--motion-ease);
    --segmented-count: 2;
    --segmented-active-index: 0;
    --segmented-indicator-width: calc((100% - (var(--segmented-control-padding) * 2) - (var(--segmented-control-gap) * (var(--segmented-count) - 1))) / var(--segmented-count));
    --segmented-indicator-offset: calc(var(--segmented-active-index) * (100% + var(--segmented-control-gap)));
    --segmented-control-width: auto;
    --segmented-control-min-width: 0;
    --segmented-control-height: 36px;
    --segmented-control-padding: 3px;
    --segmented-control-gap: 3px;
    --segmented-control-radius: var(--control-radius);
    --segmented-control-bg: var(--theme-surface-base);
    --segmented-control-border: 1px solid var(--theme-border-subtle);
    --segmented-control-shadow: none;
    --segmented-control-option-padding: 0 12px;
    --segmented-control-option-size: var(--font-size-sm);
    --segmented-control-option-line: var(--type-control-line);
    --segmented-control-option-weight: var(--type-control-weight);
    --segmented-control-option-color: var(--theme-text-muted);
    --segmented-control-option-color-hover: var(--theme-text-strong);
    --segmented-control-option-color-active: var(--emphasis-action-nav-accent-color);
    --segmented-control-indicator-bg: var(--emphasis-action-nav-accent-bg);
    --segmented-control-indicator-border: 1px solid var(--emphasis-action-nav-accent-border);
    --segmented-control-indicator-shadow: none;
    --segmented-control-transition-duration: var(--selection-control-transition-duration);
    --segmented-control-transition-ease: var(--selection-control-transition-ease);
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--segmented-count), minmax(0, 1fr));
    align-items: stretch;
    gap: var(--segmented-control-gap);
    width: var(--segmented-control-width);
    max-width: 100%;
    min-width: var(--segmented-control-min-width);
    height: var(--segmented-control-height);
    margin: 0;
    padding: var(--segmented-control-padding);
    box-sizing: border-box;
    border: var(--segmented-control-border);
    border-radius: var(--segmented-control-radius);
    background: var(--segmented-control-bg);
    box-shadow: var(--segmented-control-shadow);
    overflow: hidden;
    isolation: isolate;
}

.segmented-control__indicator {
    position: absolute;
    top: var(--segmented-control-padding);
    left: var(--segmented-control-padding);
    width: var(--segmented-indicator-width);
    height: calc(100% - (var(--segmented-control-padding) * 2));
    border-radius: calc(var(--segmented-control-radius) - var(--segmented-control-padding));
    border: var(--segmented-control-indicator-border);
    background: var(--segmented-control-indicator-bg);
    box-shadow: var(--segmented-control-indicator-shadow);
    pointer-events: none;
    z-index: 0;
    transform: translateX(var(--segmented-indicator-offset));
    transition:
        transform var(--segmented-control-transition-duration) var(--segmented-control-transition-ease),
        background-color var(--segmented-control-transition-duration) var(--segmented-control-transition-ease),
        border-color var(--segmented-control-transition-duration) var(--segmented-control-transition-ease),
        box-shadow var(--segmented-control-transition-duration) var(--segmented-control-transition-ease);
}

.segmented-control:has(> .segmented-control__option:nth-of-type(2)[aria-pressed="true"]) {
    --segmented-active-index: 1;
}

.segmented-control__option {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--control-gap-tight);
    min-width: 0;
    min-inline-size: 0;
    min-height: calc(var(--segmented-control-height) - (var(--segmented-control-padding) * 2));
    margin: 0;
    padding: var(--segmented-control-option-padding);
    border: 0;
    border-radius: calc(var(--segmented-control-radius) - var(--segmented-control-padding));
    background: transparent;
    color: var(--segmented-control-option-color);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    font-size: var(--segmented-control-option-size);
    font-weight: var(--segmented-control-option-weight);
    line-height: var(--segmented-control-option-line);
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition:
        color      var(--segmented-control-transition-duration) var(--segmented-control-transition-ease),
        box-shadow var(--segmented-control-transition-duration) var(--segmented-control-transition-ease),
        opacity    var(--segmented-control-transition-duration) var(--segmented-control-transition-ease),
        transform  var(--segmented-control-transition-duration) var(--segmented-control-transition-ease);
}

.segmented-control__option:not(:disabled):not([aria-disabled="true"]):hover {
    color: var(--segmented-control-option-color-hover);
}

.segmented-control__option:not(:disabled):not([aria-disabled="true"]):active {
    transform: scale(0.92);
}

.segmented-control__option[aria-pressed="true"] {
    color: var(--segmented-control-option-color-active);
}

.segmented-control__option:focus-visible {
    box-shadow: var(--state-focus-ring-shadow);
    outline: none;
}

.segmented-control__option:disabled,
.segmented-control__option[aria-disabled="true"] {
    opacity: var(--state-opacity-disabled);
    pointer-events: none;
}

.text-title,
.text-heading {
    color: var(--text-title-color, var(--hierarchy-title-color));
    font-size: var(--text-title-size, var(--type-body-xl-size));
    font-weight: var(--text-title-weight, var(--hierarchy-title-weight));
    line-height: var(--text-title-line, var(--text-title-line-height, 1.28));
    letter-spacing: var(--text-title-track, var(--text-title-letter-spacing, normal));
    text-transform: var(--text-title-text-transform, none);
}

.text-metric {
    color: var(--text-metric-color, var(--hierarchy-title-color));
    font-size: var(--text-metric-size, var(--type-chip-value-size));
    font-weight: var(--text-metric-weight, var(--hierarchy-strong-weight));
    line-height: var(--text-metric-line, var(--type-control-line));
    letter-spacing: var(--text-metric-track, var(--hierarchy-title-track-metric));
    text-transform: var(--text-metric-text-transform, none);
    font-variant-numeric: lining-nums tabular-nums;
}

.text-meta {
    color: var(--text-meta-color, var(--hierarchy-meta-color));
    font-size: var(--text-meta-size, var(--type-caption-size));
    font-weight: var(--text-meta-weight, var(--hierarchy-meta-weight));
    line-height: var(--text-meta-line, var(--text-meta-line-height, 1.28));
    letter-spacing: var(--text-meta-track, var(--text-meta-letter-spacing, normal));
    text-transform: var(--text-meta-text-transform, none);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.text-summary {
    color: var(--text-summary-color, var(--hierarchy-summary-color));
    font-size: var(--text-summary-size, var(--type-body-lg-size));
    font-weight: var(--text-summary-weight, var(--hierarchy-summary-weight));
    line-height: var(--text-summary-line, var(--text-summary-line-height, 1.32));
    letter-spacing: var(--text-summary-track, var(--text-summary-letter-spacing, normal));
    text-transform: var(--text-summary-text-transform, none);
}

.text-hint,
.table-intro {
    margin: var(--text-hint-margin, 0);
    color: var(--text-hint-color, var(--hierarchy-hint-color));
    font-size: var(--text-hint-size, var(--type-muted-size));
    font-weight: var(--text-hint-weight, inherit);
    line-height: var(--text-hint-line, var(--text-hint-line-height, var(--type-muted-line)));
    letter-spacing: var(--text-hint-track, var(--text-hint-letter-spacing, normal));
    text-transform: var(--text-hint-text-transform, none);
}

:where(.layout-stack, .content-body, .surface-shell, .item-card, .content-panel__control, .list-shell, .content-tile) > p {
    margin: 0;
    padding: 0;
}

:where(.layout-stack, .content-body, .surface-shell, .item-card, .content-panel__control, .list-shell, .content-tile)
    > :is(h1, h2, h3, h4, h5, h6, .text-title, .text-heading, .text-metric)
    + :is(.text-summary, .text-meta, .table-intro, .text-hint, p, .content-tile__meta, .copy-line, .badge),
:where(.layout-stack, .content-body, .surface-shell, .item-card, .content-panel__control, .list-shell, .content-tile)
    > :is(.text-summary, .text-meta, .table-intro, .text-hint, p, .content-tile__meta, .copy-line, .badge)
    + :is(.text-summary, .text-meta, .table-intro, .text-hint, .text-title, .text-heading, .text-metric, p, .content-tile__meta, .copy-line, .badge) {
    margin-top: var(--short-text-flow-gap, 0);
}

:where(.layout-stack, .content-body, .surface-shell, .item-card, .content-panel__control, .list-shell, .content-tile)
    > :is(.text-summary, .text-meta, .table-intro, .text-hint, p, .content-tile__meta, .section-head__summary, .copy-line, .badge)
    + :is(.list-shell, .list-shell--surface, .list-shell--links, [data-example-list], .content-tile, .item-card) {
    margin-top: var(--short-text-list-flow-gap, 0);
}

:where(.layout-stack, .content-body, .surface-shell, .item-card, .content-panel__control, .list-shell, .content-tile)
    > :is(.list-shell, .list-shell--surface, .list-shell--links, [data-example-list], .content-tile)
    + :is(.text-summary, .text-meta, .table-intro, .text-hint, .text-title, .text-heading, .text-metric, p, .content-tile__meta, .copy-line, .badge) {
    margin-top: var(--short-list-text-flow-gap, 0);
}

:where(.layout-stack, .content-body, .surface-shell, .item-card, .content-panel__control, .list-shell, .content-tile)
    > :is(h1, h2, h3, h4, h5, h6, .text-title, .text-heading, .text-metric, .badge, .text-summary, .text-meta, .table-intro, .text-hint, p, .content-tile__meta, .copy-line)
    + .button-panel__actions {
    margin-top: var(--short-text-action-flow-gap, 0);
}

:where(.layout-stack, .content-body, .surface-shell, .item-card, .content-panel__control, .list-shell, .content-tile)
    > .button-panel__actions
    + :is(.list-shell, .list-shell--surface, .list-shell--links, [data-example-list], .layout-grid-auto, .content-tile, .item-card, .text-summary, .text-meta, .table-intro, .text-hint, .text-title, .text-heading, .text-metric, p, .content-tile__meta, .copy-line, .badge) {
    margin-top: var(--short-action-next-flow-gap, 0);
}

.table-intro {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.text-truncate-1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-clamp-1 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.text-clamp-2 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.layout-stack {
    display: grid;
    gap: var(--layout-stack-gap, 10px);
    min-width: 0;
}

.content-body.layout-stack {
    --layout-stack-gap: var(--content-body-stack-gap, 8px);
}

.layout-cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: var(--layout-cluster-align, center);
    gap: var(--layout-cluster-gap, 12px);
    min-width: 0;
}

.layout-cluster--end {
    --layout-cluster-align: flex-end;
}

.layout-grid-auto {
    display: grid;
    gap: var(--layout-grid-gap, 12px);
    grid-template-columns: repeat(auto-fit, minmax(var(--layout-grid-min, 180px), 1fr));
}

.layout-split {
    display: flex;
    align-items: var(--layout-split-align, flex-start);
    justify-content: space-between;
    gap: var(--layout-split-gap, 12px);
}

.description-container {
    max-width: var(--layout-max-width);
    margin: 0 auto;
    text-align: right;
    padding: 0;
}

.description {
    margin: 0 30px 0 auto;
    max-inline-size: var(--content-readable-max-width);
    padding: 0;
}

.description-container p {
    margin: 0;
    padding: 0;
    color: var(--hierarchy-meta-color);
    font-size: var(--type-body-xl-size);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.description-container a {
    color: var(--link-color);
    margin: 0;
    padding: 0;
}

.interactive-container {
    max-width: var(--layout-max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: var(--space-7) var(--section-padding);
    gap: 20px;
}

.interactive-container ul {
    padding: 0;
    margin: 0;
    gap: 20px;
}

.interactive-container li {
    padding: 10px 0;
    margin: 0;
}

.copy-line {
    min-width: 0;
    display: block;
    color: inherit;
    font: inherit;
    line-height: inherit;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.copy-line--translation {
    margin-top: 1px;
    display: block;
    color: inherit;
}

.copy-line--translation::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    background: currentColor;
    -webkit-mask: url("/static/assets/icons/arrow-turn-down-right.svg") no-repeat center / contain;
    mask: url("/static/assets/icons/arrow-turn-down-right.svg") no-repeat center / contain;
    opacity: 1;
    transform: translateY(0.08em);
}

.copy-line a {
    font: inherit;
    line-height: inherit;
    color: inherit;
    text-decoration: none;
}

.copy-line a:visited {
    color: inherit;
}

.information-container {
    text-align: left;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--inner-gap);
    align-items: start;
}

.highlight {
    color: var(--txt-green-highlight);
    font-weight: var(--hierarchy-strong-weight);
}

.content-container > p:not([class]),
.content-container > .content-body > p:not([class]),
[data-content-entry-body] > p:not([class]),
[data-fade-target] > p:not([class]),
.article > p:not([class]) {
    text-align: left;
    margin: 0;
    padding: 0;
}

.content-container > p:not([class]) + p:not([class]),
.content-container > .content-body > p:not([class]) + p:not([class]),
[data-content-entry-body] > p:not([class]) + p:not([class]),
[data-fade-target] > p:not([class]) + p:not([class]),
.article > p:not([class]) + p:not([class]) {
    margin-top: var(--content-paragraph-margin-y, var(--space-3));
}

.article {
    display: grid;
    gap: var(--inner-gap);
    width: 100%;
}

.article p {
    text-align: left;
    margin: 0;
    padding: 0;
    font-size: var(--type-reading-size);
    line-height: var(--type-reading-line);
    color: var(--hierarchy-reading-color);
}

.article p:first-of-type {
    font-size: var(--type-reading-size);
    font-weight: var(--hierarchy-reading-weight);
    line-height: var(--type-reading-line);
    color: var(--hierarchy-reading-color);
}

.bold {
    font-weight: var(--hierarchy-strong-weight);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--badge-gap, 4px);
    min-height: var(--badge-min-height, 20px);
    padding: var(--badge-padding, 1px 7px);
    border-radius: var(--badge-radius, var(--control-radius));
    border: var(--badge-border, 1px solid var(--theme-border-normal));
    background: var(--badge-bg, var(--container-surface-subsection, var(--theme-surface-subsection)));
    color: var(--badge-color, var(--hierarchy-status-color));
    font-size: var(--badge-size, var(--badge-font-size, 11px));
    font-weight: var(--badge-weight, var(--badge-font-weight, var(--hierarchy-status-weight)));
    line-height: var(--badge-line, var(--badge-line-height, 1.15));
    letter-spacing: var(--badge-track, var(--badge-letter-spacing, 0));
    text-transform: var(--badge-text-transform, var(--hierarchy-status-trigger-transform));
    white-space: nowrap;
    cursor: default;
}

.badge--beta {
    --badge-color: var(--theme-text-normal);
    --badge-border: 1px dashed var(--theme-border-normal);
    --badge-bg: var(--container-surface-section, var(--theme-surface-subtle));
}

.badge--quiet {
    --badge-bg: var(--container-surface-subsection, var(--theme-surface-subsection));
}

.badge--accent {
    --badge-color: var(--theme-text-strong);
    --badge-border: 1px solid var(--theme-border-normal);
    --badge-bg: var(--container-surface-section, var(--theme-surface-subtle));
}

.status-trigger {
    --status-trigger-min-height: 28px;
    --status-trigger-min-width: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--status-trigger-gap, 6px);
    min-height: var(--status-trigger-min-height);
    min-width: var(--status-trigger-min-width);
    padding: var(--status-trigger-padding, 0 10px);
    border-radius: var(--status-trigger-radius, var(--button-radius-unified));
    border: var(--status-trigger-border, 1px solid var(--theme-border-subtle));
    background: var(--status-trigger-bg, var(--container-surface-shell, var(--theme-surface-shell)));
    color: var(--status-trigger-color, var(--hierarchy-status-color));
    font-size: var(--status-trigger-font-size, 11px);
    font-weight: var(--status-trigger-font-weight, var(--hierarchy-status-trigger-weight));
    line-height: var(--status-trigger-line-height, 1);
    letter-spacing: var(--status-trigger-letter-spacing, var(--hierarchy-status-trigger-track));
    text-transform: var(--status-trigger-text-transform, var(--hierarchy-status-trigger-transform));
    white-space: nowrap;
    text-decoration: none;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition:
        background-color var(--button-transition-duration) var(--button-transition-ease),
        border-color     var(--button-transition-duration) var(--button-transition-ease),
        color            var(--button-transition-duration) var(--button-transition-ease),
        box-shadow       var(--button-transition-duration) var(--button-transition-ease),
        transform        var(--button-transition-duration) var(--button-transition-ease);
}

.status-trigger:not(:disabled):not([aria-disabled="true"]):active {
    transform: scale(0.94);
}

.status-trigger:hover,
.status-trigger:focus-visible,
.status-trigger[aria-expanded="true"] {
    background: var(--status-trigger-bg-hover, var(--container-surface-section, var(--theme-surface-subtle)));
    border-color: var(--status-trigger-border-hover, var(--theme-border-control-hover));
    color: var(--status-trigger-color-hover, var(--theme-text-strong));
    outline: none;
}

.status-trigger:focus-visible {
    box-shadow: var(--state-focus-ring-shadow);
}

.status-trigger--icon {
    --status-trigger-min-height: 24px;
    --status-trigger-min-width: 28px;
    gap: 0;
    padding: 0 8px;
}

.status-trigger .action-icon {
    --action-icon-size: 12px;
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    opacity: var(--state-opacity-muted);
}

[data-section-head-state].status-trigger {
    --status-trigger-min-height: 22px;
    --status-trigger-min-width: 0;
    --status-trigger-gap: 5px;
    --status-trigger-padding: 0 8px;
    --status-trigger-border: 1px solid var(--theme-border-subtle);
    --status-trigger-border-hover: var(--theme-border-control);
    --status-trigger-bg: var(--container-surface-section, var(--theme-surface-subtle));
    --status-trigger-bg-hover: var(--container-surface-subsection, var(--theme-surface-subsection));
    --status-trigger-color: var(--theme-text-muted);
    --status-trigger-color-hover: var(--theme-text-normal);
    --status-trigger-font-size: var(--font-size-xs);
    --status-trigger-font-weight: var(--hierarchy-status-weight);
    --status-trigger-line-height: var(--type-label-line);
    --status-trigger-letter-spacing: 0;
    --status-trigger-text-transform: none;
    margin: 0;
}

[data-section-head-state].status-trigger .action-icon {
    opacity: 0.84;
}

.progress-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.progress-card {
    --item-card-padding: var(--progress-card-padding);
    --item-card-gap: var(--progress-card-gap);
    --item-card-radius: var(--progress-card-radius);
    --item-card-bg: var(--theme-surface-base);
    --item-card-border: 1px solid var(--theme-border-normal);
    --item-card-shadow: var(--shadow-none);
    position: relative;
    overflow: hidden;
}

.progress-label {
    --text-meta-size: var(--progress-label-size);
    --text-meta-color: var(--progress-label-color);
    --text-meta-track: var(--progress-label-track);
    --text-meta-text-transform: var(--progress-label-transform);
}

.progress-value {
    --text-metric-size: var(--progress-value-size);
    --text-metric-weight: var(--progress-value-weight);
    --text-metric-line: var(--progress-value-line);
}

.progress-bar {
    width: 100%;
    overflow: hidden;
    clip-path: inset(0 round var(--progress-bar-radius));
}

.progress-bar {
    height: var(--progress-bar-height);
    margin-top: 6px;
    background-color: var(--progress-bar-bg, var(--progress-track-bg));
}

.progress-bar span {
    display: block;
    width: var(--progress-fill, 0%);
    height: 100%;
}

.progress-bar span {
    background: var(--progress-bar-fill, var(--progress-bar-fill-default));
}

.game-page .progress-bar span {
    --progress-bar-fill: linear-gradient(90deg, rgba(var(--game-teal), 1), rgba(var(--game-sky), 1));
}

.progress-note {
    margin-top: 10px;
    --text-hint-size: var(--progress-note-size);
    --text-hint-line: var(--progress-note-line);
    --text-hint-color: var(--progress-note-color);
}
