#revenue-chart {
    margin: 38px 0 30px;
    font-family: "IBM Plex Mono", monospace;
}

#revenue-chart[hidden] {
    display: none;
}

#revenue-chart h2 {
    text-align: center;
    color: #888;
    font: 400 15px "IBM Plex Mono", monospace;
    letter-spacing: 3px;
    margin: 0 0 26px;
}

.revenue-bar {
    display: flex;
    width: 100%;
    height: 44px;
    margin-bottom: 30px;
}

.revenue-segment {
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    appearance: none;
    cursor: pointer;
}

.revenue-labels {
    position: relative;
}

.revenue-label {
    position: absolute;
    top: 3px;
    width: max-content;
    max-width: none;
    height: auto;
    box-sizing: border-box;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    appearance: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: normal;
    line-height: 1.3;
    text-align: center;
    overflow-wrap: anywhere;
    word-break: normal;
    cursor: pointer;
}

#revenue-chart .revenue-label {
    background-color: transparent;
}

#revenue-chart .revenue-label:hover {
    background-color: transparent;
}

.revenue-label.revenue-source-hovered {
    color: var(--source-hover-text-color, var(--source-color, currentColor));
}

.revenue-segment.revenue-source-hovered {
    opacity: 0.7;
}

.revenue-arrow.revenue-source-hovered {
    fill: var(--hover-source-color, #000);
}

.revenue-leader.revenue-source-hovered {
    stroke: var(--hover-source-color, #000);
}

.revenue-label strong {
    display: block;
    margin-bottom: 7px;
    font-size: 15px;
}

.revenue-label-name {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.revenue-label-name-text {
    display: block;
    width: 100%;
    text-align: center;
}

.revenue-connectors {
    position: absolute;
    display: block;
    width: 100%;
    height: 75px;
    margin: 0;
    overflow: visible;
    pointer-events: none;
}

.revenue-connector-capture-area {
    box-sizing: border-box;
    position: relative;
    display: block;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
}

.revenue-arrow {
    fill: var(--source-color, #000);
    stroke: none;
    pointer-events: visiblePainted;
}

.revenue-leader {
    fill: none;
    stroke: var(--source-color, #000);
    stroke-width: 1;
    stroke-linejoin: round;
    stroke-linecap: butt;
    pointer-events: visiblePainted;
}

body.dark #revenue-chart .revenue-arrow:not(.revenue-source-hovered) {
    fill: #bbb;
}

body.dark #revenue-chart .revenue-leader:not(.revenue-source-hovered) {
    stroke: #bbb;
}

.revenue-explanations-toggle {
    display: block;
    height: auto;
    margin: 20px 0px;
    padding: 7px 20px;
    border: 0;
    background: #ffffff;
    color: #666;
    font: 15px "IBM Plex Mono", monospace;
    text-decoration: none;
    cursor: pointer;
}

#revenue-chart .revenue-explanations-toggle {
    background-color: #ffffff;
}

body.dark #revenue-chart .revenue-explanations-toggle {
    color: #bbb;
}

.revenue-explanations-toggle[hidden] {
    display: none;
}

#revenue-chart .revenue-explanations-toggle:hover {
    background-color: #ffffff;
    color: #000;
}

body.dark #revenue-chart .revenue-explanations-toggle:hover {
    color: #fff;
}

.revenue-explanations-toggle::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 8px 3px 0;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 150ms ease;
}

.revenue-explanations-toggle[aria-expanded="true"]::before {
    margin-bottom: 0;
    transform: rotate(225deg);
}

.revenue-explanations-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.revenue-explanations {
    max-width: 720px;
    margin: 12px auto 0;
    padding: 0 12px;
    box-sizing: border-box;
    list-style: none;
    text-align: left;
}

.revenue-explanations[hidden] {
    display: none;
}

.revenue-explanation {
    margin: 0 0 8px;
    font: 16px/1.5 "IBM Plex Mono", monospace;
    overflow-wrap: anywhere;
}

.revenue-explanation:last-child {
    margin-bottom: 0;
}

.revenue-explanation strong {
    font-weight: 600;
}

.revenue-explanation-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 5px;
    background: var(--source-color);
}

.revenue-explanation--active strong {
    text-decoration: underline;
    text-decoration-color: var(--source-color);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.revenue-segment:focus-visible, .revenue-label:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    z-index: 2;
}

.revenue-segment[aria-pressed="true"] {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    z-index: 1;
}

.revenue-label[aria-pressed="true"] strong {
    text-decoration: underline;
    text-decoration-color: var(--source-color);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

@media (max-width: 520px) {
    #revenue-chart h2 {
        font-size: 13px;
        letter-spacing: 2px;
    }

    .revenue-label {
        max-width: none;
        font-size: 10px;
    }

    .revenue-label strong {
        font-size: 13px;
    }
}

#revenue-status {
    color: #888;
    font: 18px "IBM Plex Mono", monospace;
    text-align: center;
    margin: 20px 0;
}

#revenue-status[hidden] {
    display: none;
}

.revenue-loading-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 12px;
    border: 1.5px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -1.5px;
    animation: revenue-loading-spin 800ms linear infinite;
}

@keyframes revenue-loading-spin {
    to { transform: rotate(360deg); }
}

#revenue-status button {
    display: inline;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0 0 0 5px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

#revenue-status button:disabled {
    opacity: .5;
    cursor: wait;
}
