.y-curve-widget {
    margin: 4px auto;
    max-width: 1340px;
    position: relative;
    z-index: 0;
    isolation: isolate;
    padding: var(--y-curve-padding, 0px);
    color: var(--y-curve-text-color);
    font-family: var(--y-curve-font-family);
    font-size: var(--y-curve-font-size);
    font-weight: var(--y-curve-font-weight);
}

.y-curve-header {
    margin-bottom: 24px;
}

.y-curve-title {
    margin: 0 0 8px;
    font-size: clamp(24px, 2.6vw, 36px);
}

.y-curve-subtitle {
    margin: 0;
    opacity: 0.8;
}

.y-curve-zones {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0px;
    aspect-ratio: var(--ytc-widget-aspect-ratio, 4 / 3);
    min-height: 300px;
    width: 100%;
    align-items: stretch;
}

.y-curve-zone {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: 3.4em 1fr;
    min-width: 0;
}

.y-curve-zone.ytc-phase-has-flow {
    z-index: 6;
}

.y-curve-widget.ytc-hide-phase-titles .y-curve-zone {
    grid-template-rows: 1fr;
}

.y-curve-widget.ytc-hide-phase-titles .y-zone-title {
    display: none;
}

.y-zone-title {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-size: var(--y-zone-title-size, 16px);
    padding-top: 5px;
    margin: 0 0 8px;
    line-height: 1.2;
    min-height: 0;
    text-align: center;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.y-zone-box {
    position: relative;
    border: 2px solid #222;
    border-radius: 0px;
    min-height: 300px;
    padding: 10px 8px 8px;
    overflow: hidden;
    box-sizing: border-box;
}

.y-curve-zone.ytc-phase-has-flow .y-zone-box {
    overflow: visible;
}

.y-zone-toplines {
    position: relative;
    z-index: 4;
    text-align: left;
}

.y-zone-toplines p {
    margin: 0;
    line-height: 1.22;
}

.ytc-vertical-text {
    display: inline-block;
    white-space: nowrap;
    line-height: 1;
}

.ytc-vertical-text-left {
    transform: rotate(-90deg);
    transform-origin: left bottom;
}

.ytc-vertical-text-right {
    transform: rotate(-90deg);
    transform-origin: right bottom;
}

.ytc-vertical-text-centre,
.ytc-vertical-text-center {
    transform: translateX(-50%) rotate(-90deg);
    transform-origin: center bottom;
}

.y-zone-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 2;
    overflow: visible;
}

.ytc-hover-zone {
    cursor: pointer;
    pointer-events: all;
    opacity: 0;
}

.ytc-hover-ring {
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
}

.ytc-hover-ring.is-active {
    opacity: 1;
}

.ytc-milestone-glow {
    pointer-events: none;
    stroke: var(--ytc-milestone-glow-color, #ff4600);
    stroke-width: var(--ytc-milestone-glow-line-thickness, 1px);
    opacity: var(--ytc-milestone-glow-opacity-start, 0);
    filter: drop-shadow(0 0 var(--ytc-milestone-glow-blur, 0px) var(--ytc-milestone-glow-color, #ff4600));
    vector-effect: non-scaling-stroke;
    transform-box: fill-box;
    transform-origin: center;
    animation:
        ytc-milestone-glow-pulse var(--ytc-milestone-glow-cycle-time, 4s) ease-in-out infinite,
        ytc-milestone-glow-scale var(--ytc-milestone-glow-cycle-time, 4s) ease-in-out infinite;
}

@keyframes ytc-milestone-glow-pulse {
    0% {
        opacity: var(--ytc-milestone-glow-opacity-start, 0);
    }
    50% {
        opacity: var(--ytc-milestone-glow-opacity-end, 1);
    }
    100% {
        opacity: var(--ytc-milestone-glow-opacity-start, 0);
    }
}

@keyframes ytc-milestone-glow-scale {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.18);
    }
    100% {
        transform: scale(1);
    }
}

.ytc-hover-modal {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 180ms ease;
    z-index: 40;
}

.ytc-hover-modal.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.ytc-hover-modal-card {
    position: relative;
    width: min(900px, calc(100% - 40px));
    max-height: min(70vh, 560px);
    overflow: auto;
    box-sizing: border-box;
    /* padding: 14px 16px; */
    background: rgba(0, 0, 0, 0.86);
    color: #fff;
}

.ytc-hover-modal-close {
    position: absolute;
    top: 8px;
    right: 10px;
    z-index: 2;
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    color: var(--ytc-exit-color, #fff);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    padding: 0;
}

.ytc-hover-modal-close svg {
    width: 12px;
    height: 12px;
    display: block;
}

.ytc-hover-modal-close:hover,
.ytc-hover-modal-close:focus {
    color: var(--ytc-exit-hover-color, #fff);
}

.ytc-hover-modal-content > *:first-child {
    margin-top: 0;
}

.ytc-hover-modal-content > *:last-child {
    margin-bottom: 0;
}

.y-zone-side-notes {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 46px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    z-index: 6;
}

.y-zone-side-notes span {
    max-width: 80%;
    line-height: 1.18;
}

.y-zone-side-notes span:last-child {
    text-align: right;
}

.y-zone-audience {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 6;
    text-align: center;
}

.y-zone-audience-line {
    display: block;
    margin: 2px auto;
    border-top: 1px solid currentColor;
}

.y-zone-marker-label {
    position: absolute;
    z-index: 7;
    transform: translate(-50%, -100%) rotate(-90deg);
    transform-origin: center;
    white-space: nowrap;
    line-height: 1;
    pointer-events: none;
}

.ytc-widget-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}

.ytc-footer-graphic {
    position: relative;
    flex: 1;
    min-width: 0;
    min-height: max(var(--ytc-footer-line-width, 1px), var(--ytc-footer-arrow-width, 10px));
}

.ytc-footer-graphic-line,
.ytc-footer-graphic-arrow-right,
.ytc-footer-graphic-arrow-left {
    border-top: 0;
}

.ytc-footer-graphic-arrow-right {
    padding-right: 0;
}

.ytc-footer-graphic-arrow-right::before,
.ytc-footer-graphic-arrow-left::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border-top-width: var(--ytc-footer-line-width, 1px);
    border-top-style: var(--ytc-footer-line-style, solid);
    border-top-color: currentColor;
}

.ytc-footer-graphic-arrow-right::before {
    left: 0;
    right: var(--ytc-footer-arrow-length, 14px);
}

.ytc-footer-graphic-arrow-right::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    width: 0;
    height: 0;
    transform: translateY(-50%);
    border-top: calc(var(--ytc-footer-arrow-width, 10px) / 2) solid transparent;
    border-bottom: calc(var(--ytc-footer-arrow-width, 10px) / 2) solid transparent;
    border-left: var(--ytc-footer-arrow-length, 14px) solid currentColor;
}

.ytc-footer-graphic-arrow-left {
    padding-left: 0;
}

.ytc-footer-graphic-arrow-left::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 0;
    height: 0;
    transform: translateY(-50%);
    border-top: calc(var(--ytc-footer-arrow-width, 10px) / 2) solid transparent;
    border-bottom: calc(var(--ytc-footer-arrow-width, 10px) / 2) solid transparent;
    border-right: var(--ytc-footer-arrow-length, 14px) solid currentColor;
}

.ytc-footer-graphic-arrow-left::after {
    left: var(--ytc-footer-arrow-length, 14px);
    right: 0;
}

.ytc-footer-text {
    white-space: nowrap;
    line-height: 1.2;
}

.ytc-widget-footer-layout-graphic_top_text_bottom,
.ytc-widget-footer-layout-text_top_graphic_bottom,
.ytc-widget-footer-layout-just_graphic,
.ytc-widget-footer-layout-just_text {
    flex-direction: column;
    align-items: stretch;
}

.ytc-widget-footer-layout-graphic_top_text_bottom .ytc-footer-graphic,
.ytc-widget-footer-layout-text_top_graphic_bottom .ytc-footer-graphic,
.ytc-widget-footer-layout-just_graphic .ytc-footer-graphic {
    width: 100%;
}

.ytc-widget-footer-layout-graphic_top_text_bottom .ytc-footer-text,
.ytc-widget-footer-layout-text_top_graphic_bottom .ytc-footer-text,
.ytc-widget-footer-layout-just_text .ytc-footer-text {
    text-align: center;
}

.ytc-widget-footer-layout-text_top_graphic_bottom .ytc-footer-text {
    order: 1;
}

.ytc-widget-footer-layout-text_top_graphic_bottom .ytc-footer-graphic {
    order: 2;
}

.ytc-widget-footer-layout-graphic_top_text_left,
.ytc-widget-footer-layout-graphic_top_text_right {
    flex-direction: row;
    align-items: center;
}

.ytc-widget-footer-layout-graphic_top_text_left .ytc-footer-text {
    order: 1;
}

.ytc-widget-footer-layout-graphic_top_text_left .ytc-footer-graphic {
    order: 2;
}

.ytc-widget-footer-layout-graphic_top_text_right .ytc-footer-graphic {
    order: 1;
}

.ytc-widget-footer-layout-graphic_top_text_right .ytc-footer-text {
    order: 2;
}

@media (max-width: 760px) {
    .y-curve-zones {
        aspect-ratio: auto;
        grid-template-columns: 1fr;
    }

    .y-curve-zone {
        min-height: 380px;
    }

    .y-zone-box {
        min-height: 360px;
    }

    .y-curve-widget {
        padding: var(--y-curve-padding, 0px);
    }

    .ytc-footer-text {
        white-space: normal;
    }
}
