.chord-help {
    --chord-help-background: var(--bg-main);
    --chord-help-surface: var(--bg-surface);
    --chord-help-text: var(--text-primary);
    --chord-help-muted: var(--text-secondary);
    --chord-help-border: var(--border-color);
    --chord-help-accent: var(--accent-blue);
    --chord-help-accent-strong: var(--accent-strong);
    --chord-help-on-accent: var(--header-text);
    --chord-help-focus: color-mix(in srgb, var(--accent-blue) 45%, transparent);
    --chord-help-soft-accent: color-mix(in srgb, var(--accent-blue) 7%, transparent);
    --chord-help-shadow: color-mix(in srgb, var(--text-primary) 7%, transparent);
    --chord-help-body-size: clamp(12px, calc(10px + 0.55vw), 12.5px);
    --chord-help-heading-size: clamp(13px, calc(11.5px + 0.45vw), 13.5px);
    --chord-help-compact-size: clamp(9.5px, calc(4.25px + 1.5vw), 11px);
    --chord-help-micro-size: clamp(9px, calc(8.1px + 0.25vw), 9.25px);
    --chord-help-body-leading: 1.65;

    padding-block: 24px 72px;
    padding-inline: 12px;
    border-block-start: 1px solid var(--chord-help-border);
    background: var(--chord-help-background);
    color: var(--chord-help-text);
    overflow-wrap: anywhere;
    word-break: normal;
    line-break: strict;
}

.chord-help__header {
    margin-block-end: 12px;
}

.chord-help__header h2 {
    margin: 0;
    color: var(--chord-help-text);
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.5;
}

.chord-help__lead {
    margin-block: 6px 0;
    color: var(--chord-help-muted);
    font-size: var(--chord-help-body-size);
    line-height: var(--chord-help-body-leading);
    letter-spacing: -0.01em;
}

.chord-help__items {
    display: grid;
    gap: 8px;
}

.chord-help__item {
    overflow: clip;
    border: 1px solid var(--chord-help-border);
    border-radius: 8px;
    background: var(--chord-help-surface);
    box-shadow: 0 1px 4px var(--chord-help-shadow);
}

.chord-help__summary {
    position: relative;
    display: grid;
    align-items: center;
    min-block-size: 44px;
    padding-block: 11px;
    padding-inline: 12px 40px;
    color: var(--chord-help-text);
    cursor: pointer;
    list-style: none;
}

.chord-help__summary::-webkit-details-marker {
    display: none;
}

.chord-help__summary::marker {
    content: "";
}

.chord-help__summary h3 {
    margin: 0;
    color: inherit;
    font-size: var(--chord-help-heading-size);
    font-weight: 800;
    line-height: 1.5;
}

.chord-help__summary::after {
    content: "";
    position: absolute;
    inset-block-start: 50%;
    inset-inline-end: 16px;
    inline-size: 7px;
    block-size: 7px;
    border-inline-end: 2px solid var(--chord-help-accent);
    border-block-end: 2px solid var(--chord-help-accent);
    transform: translateY(-65%) rotate(45deg);
    transform-origin: center;
    transition: transform 0.2s ease;
}

.chord-help__item[open] > .chord-help__summary {
    border-block-end: 1px solid var(--chord-help-border);
}

.chord-help__item[open] > .chord-help__summary::after {
    transform: translateY(-30%) rotate(-135deg);
}

.chord-help__summary:focus-visible,
.chord-help a:focus-visible {
    outline: 2px solid var(--chord-help-focus);
    outline-offset: 2px;
}

.chord-help__panel {
    padding-block: 13px;
    padding-inline: 12px;
    color: var(--chord-help-muted);
    font-size: var(--chord-help-body-size);
    line-height: var(--chord-help-body-leading);
}

.chord-help__panel p {
    margin: 0;
}

.chord-help__panel p + p {
    margin-block-start: 8px;
}

.chord-help__steps {
    display: grid;
    gap: 9px;
    margin-block: 0 13px;
    padding: 0;
    counter-reset: chord-help-step;
    list-style: none;
}

.chord-help__step {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    counter-increment: chord-help-step;
}

.chord-help__step::before {
    content: counter(chord-help-step);
    display: grid;
    place-items: center;
    inline-size: 22px;
    block-size: 22px;
    border-radius: 50%;
    background: var(--chord-help-accent-strong);
    color: var(--chord-help-on-accent);
    font-family: var(--font-ui);
    font-size: var(--chord-help-body-size);
    font-weight: 800;
    line-height: 1;
}

.chord-help__step strong {
    display: block;
    margin-block-end: 2px;
    color: var(--chord-help-text);
    font-size: var(--chord-help-body-size);
    line-height: 1.4;
}

.chord-help__display {
    margin: 0;
}

.chord-help__display-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 200px));
    justify-content: center;
    gap: 6px;
    inline-size: calc(100% + 24px);
    margin-inline: -12px;
}

.chord-help__preview {
    min-inline-size: 0;
}

.chord-help__preview-title {
    margin-block: 0 6px;
    padding-inline: 6px;
    color: var(--chord-help-text);
    font-size: var(--chord-help-body-size);
    font-weight: 800;
    line-height: 1.4;
}

.chord-help__diagram-preview {
    display: grid;
    grid-template-columns: minmax(0, 200px);
    grid-auto-rows: 110px;
    min-inline-size: 0;
    min-block-size: 0;
}

.chord-help .chord-card--embedded {
    border-color: transparent;
    box-shadow: none;
}

.chord-help .staff-modal__notation--embedded {
    border-color: transparent;
    box-shadow: none;
}

#helper-staff-notation {
    display: block;
    inline-size: 100%;
    max-inline-size: 272px;
    block-size: auto;
    min-block-size: 0;
    overflow: visible;
    justify-self: center;
}

.chord-help__open-marker {
    display: grid;
    place-items: center;
    inline-size: 14px;
    block-size: 14px;
    border: 1.25px solid var(--chord-help-accent);
    border-radius: 50%;
    color: var(--chord-help-accent);
    font-family: var(--font-ui);
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
}

.chord-help__mute-marker {
    display: grid;
    place-items: center;
    inline-size: 16px;
    block-size: 16px;
    color: var(--chord-help-muted);
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.chord-help__legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.chord-help__legend li {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    min-inline-size: 0;
    color: var(--chord-help-muted);
    font-size: var(--chord-help-compact-size);
    line-height: 1.45;
}

.chord-help__legend-symbol {
    display: grid;
    place-items: center;
    inline-size: 18px;
    block-size: 18px;
}

.chord-help__legend li > span:last-child {
    white-space: nowrap;
}


.chord-help__inline-label {
    color: var(--chord-help-text);
    font-weight: 800;
    white-space: nowrap;
}

.chord-help__feature-list {
    display: grid;
    margin: 0;
    border-block: 1px solid var(--chord-help-border);
}

.chord-help__feature-row {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-block-size: 34px;
    padding-block: 6px;
    border-block-end: 1px solid var(--chord-help-border);
}

.chord-help__feature-row:last-child {
    border-block-end: 0;
}

.chord-help__feature-row dt,
.chord-help__operation-row dt {
    color: var(--chord-help-text);
    font-weight: 800;
    line-height: 1.35;
    white-space: nowrap;
}

.chord-help__feature-row dd,
.chord-help__operation-row dd {
    min-inline-size: 0;
    margin: 0;
    color: var(--chord-help-muted);
    line-height: 1.4;
}

.chord-help__operation-group {
    margin-block-start: 8px;
}

.chord-help__operation-heading {
    display: inline-flex;
    align-items: center;
    margin: 0 0 6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--chord-help-soft-accent);
    color: var(--chord-help-accent);
    font-size: var(--chord-help-body-size);
    font-weight: 800;
    line-height: 1.3;
}

.chord-help__operation-list {
    display: grid;
    gap: 6px;
    margin: 0;
}

.chord-help__operation-row {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 7px 9px;
    border: 1px solid var(--chord-help-border);
    border-radius: 8px;
    background: var(--chord-help-soft-accent);
}

.chord-help__operation-row dd {
    font-size: 10px;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

@media (max-width: 400px) {
    .chord-help__feature-row,
    .chord-help__operation-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .chord-help__feature-row dt,
    .chord-help__operation-row dt,
    .chord-help__inline-label {
        white-space: normal;
    }

    .chord-help__operation-row dd {
        white-space: normal;
    }
}

.chord-help__basic-intro {
    margin-block-end: 10px !important;
}

.chord-help__basic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 200px));
    justify-content: center;
    gap: 6px;
    inline-size: calc(100% + 24px);
    margin-block: 0 10px;
    margin-inline: -12px;
    padding: 0;
    list-style: none;
}

.chord-help__basic-item {
    min-inline-size: 0;
    margin: 0;
}

.chord-help__basic-item figure {
    display: grid;
    grid-template-rows: auto 110px;
    gap: 4px;
    min-inline-size: 0;
    margin: 0;
}

.chord-help__basic-item figcaption {
    margin: 0;
    color: var(--chord-help-text);
    font-family: var(--font-ui);
    font-size: var(--chord-help-body-size);
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
}

.chord-help__basic-diagram {
    display: grid;
    min-inline-size: 0;
    min-block-size: 0;
}

.chord-help__basic-note {
    margin-block-start: 10px !important;
    padding-block-start: 10px;
    border-block-start: 1px solid var(--chord-help-border);
    font-size: var(--chord-help-body-size);
}

.chord-help__type-groups {
    display: grid;
    gap: 12px;
    margin-block-start: 12px;
}

.chord-help__type-group h4 {
    margin-block: 0 6px;
    color: var(--chord-help-text);
    font-size: var(--chord-help-body-size);
    line-height: 1.4;
}

.chord-help__type-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin: 0;
}

.chord-help__type-item {
    display: grid;
    grid-template-rows: auto auto;
    align-content: center;
    min-inline-size: 0;
    block-size: 44px;
    padding-block: 3px;
    padding-inline: 4px;
    border: 1px solid var(--chord-help-border);
    border-radius: 6px;
    background: var(--chord-help-surface);
    text-align: center;
}

.chord-help__type-item dt {
    color: var(--chord-help-text);
    font-family: var(--font-ui);
    font-size: var(--chord-help-micro-size);
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
}

.chord-help__type-item dd {
    min-inline-size: 0;
    margin-block: 1px 0;
    color: var(--chord-help-muted);
    font-size: var(--chord-help-micro-size);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.chord-help__related {
    display: grid;
    margin-block-start: 16px;
    border-block: 1px solid var(--chord-help-border);
}

.chord-help__related a {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-block-size: 44px;
    padding-inline: 4px 56px;
    border-block-end: 1px solid var(--chord-help-border);
    color: var(--chord-help-text);
    font-size: var(--chord-help-body-size);
    font-weight: 700;
    text-decoration: none;
}

.chord-help__related a:last-child {
    border-block-end: 0;
}

.chord-help__related a::after {
    content: "›";
    color: var(--chord-help-accent);
    font-size: 17px;
    line-height: 1;
}

.chord-help__copyright {
    margin-block-start: 20px;
    color: var(--chord-help-muted);
    font-size: var(--chord-help-micro-size);
    text-align: center;
    opacity: 0.82;
}

.chord-help__copyright a {
    color: inherit;
    text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
    .chord-help__summary::after {
        transition: none;
    }
}

.chord-help__display-meta {
    display: grid;
    gap: 8px;
    margin-block-start: 10px;
    padding-block: 10px 8px;
    border-block: 1px solid var(--chord-help-border);
}

.chord-help__orientation-note {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    margin: 0;
    color: var(--chord-help-muted);
    font-size: var(--chord-help-body-size);
    line-height: 1.45;
}

.chord-help__orientation-axis {
    display: grid;
    gap: 1px;
    padding-block: 4px;
    padding-inline: 5px;
    border-radius: 5px;
    background: var(--chord-help-soft-accent);
    color: var(--chord-help-accent);
    font-family: var(--font-ui);
    font-size: var(--chord-help-micro-size);
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}

.chord-help__display figcaption {
    margin-block-start: 8px;
    color: var(--chord-help-muted);
    font-size: var(--chord-help-body-size);
    line-height: 1.55;
}

.chord-help__reading-note {
    margin: 0;
    color: var(--chord-help-muted);
}

.chord-help__utility-note {
    margin-block: 8px 0;
    padding-block: 7px;
    padding-inline: 9px;
    border: 1px solid var(--chord-help-border);
    border-radius: 7px;
    background: var(--chord-help-soft-accent);
    color: var(--chord-help-muted);
    line-height: 1.55;
}

.chord-help__utility-note strong {
    color: var(--chord-help-accent);
    font-weight: 800;
}

.chord-help__step span,
.chord-help__display figcaption,
.chord-help__orientation-note,
.chord-help__reading-note,
.chord-help__utility-note {
    letter-spacing: -0.01em;
}
