.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.metric {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stock-widget {
    grid-column: 1;
    grid-row: 1 / 3;
    min-height: 250px;
}

.plan-explanation {
    margin: 20px 0;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.plan-explanation p {
    margin: 10px 0;
    line-height: 1.6;
    color: #333;
}

#estimate-footnote {
    display: block;
    margin-top: 10px;
    font-size: 12px;
    color: #666;
    text-align: center;
}

.videos-container, .xposts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.videos-container iframe {
    flex: 0 0 400px;
    height: 225px;
}

.xposts-container blockquote {
    flex: 0 0 200px;
    min-height: 120px;
}

#current-market-cap, #next-milestone-percent, #countdown {
    font-size: 22px;
    font-weight: bold;
    color: #e82127;
    margin: 10px 0;
}

.metric h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.metric div {
    font-size: 22px;
    font-weight: bold;
    color: #e82127;
}

header {
    background-color: #000;
    color: #fff;
    text-align: center;
    padding: 20px;
}

h1 {
    margin: 0;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background-color: #ddd;
    border-radius: 15px;
    position: relative;
    margin: 20px 0;
}

.progress-container {
    position: relative;
    margin-top: 60px;
    padding: 0 20px;
}

.progress-fill {
    height: 100%;
    background-color: #e82127;
    border-radius: 15px 0 0 15px;
    width: 0%;
    transition: width 1s ease;
}

.milestone-amounts {
    position: relative;
    height: 20px;
    margin-top: 10px;
}

.milestone-amounts span {
    position: absolute;
    top: 0;
    font-size: 12px;
    color: #000;
    transform: translateX(-50%);
    white-space: nowrap;
}

.milestone {
    position: absolute;
    top: -10px;
    width: 2px;
    height: 50px;
    background-color: #000;
    transform: translateX(-50%);
}

.milestone::after {
    content: attr(data-label);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #000;
    white-space: nowrap;
}

section {
    padding: 20px;
    margin: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.tranche-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.tranche {
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 8px;
}

.progress-bar.small {
    height: 20px;
}

.gauges {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

.gauge {
    text-align: center;
    margin: 20px;
    position: relative;
    height: 140px;
    padding-bottom: 20px;
}

.gauge svg {
    margin-bottom: 0;
}

.gauge-text {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    font-weight: bold;
    color: #e82127;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 1;
}

.ebitda-progress {
    position: relative;
    margin-top: 60px;
    padding: 0 20px;
}

.ebitda-bar {
    width: 100%;
    height: 30px;
    background-color: #ddd;
    border-radius: 15px;
    position: relative;
    margin: 20px 0;
}

.ebitda-fill {
    height: 100%;
    background-color: #e82127;
    border-radius: 15px 0 0 15px;
    width: 0%;
    transition: width 1s ease;
}

.ebitda-milestone {
    position: absolute;
    top: -10px;
    width: 2px;
    height: 50px;
    background-color: #000;
    transform: translateX(-50%);
}

.ebitda-milestone::after {
    content: attr(data-label);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #000;
    white-space: nowrap;
}

.ebitda-amounts {
    position: relative;
    height: 20px;
    margin-top: 10px;
}

.ebitda-amounts span {
    position: absolute;
    top: 0;
    font-size: 12px;
    color: #000;
    transform: translateX(-50%);
    white-space: nowrap;
}

.milestone.no-line, .ebitda-milestone.no-line {
    background-color: transparent;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.chart {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.chart h3 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 18px;
    color: #333;
}

.tradingview-widget-container {
    height: 300px;
}

/* Resources section link spacing */
#links a {
    display: block;
    margin-bottom: 6px;
    line-height: 1.5;
    color: #1da1f2;
    text-decoration: none;
}

#links a:first-of-type {
    margin-top: 15px;
}

#links a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Key metrics responsive grid */
    .metrics-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 15px;
    }

    /* Stock widget takes full width on mobile */
    .stock-widget {
        grid-column: 1;
        grid-row: auto;
        min-height: 200px;
    }

    /* TradingView widget responsive */
    .tradingview-widget-container {
        height: 250px;
    }

    /* Progress meters vertical layout */
    .progress-container {
        margin-top: 40px;
    }

    .progress-bar {
    width: 30px;
    height: 350px; /* Increased from 200px for better mobile visibility */
    margin: 20px auto;
    border-radius: 15px;
    position: relative; /* anchor abs-positioned milestone lines */
    overflow: visible;  /* allow lines to extend outside to left/right */
    }

    .progress-fill {
        width: 100%;
        height: 0%;
        background-color: #e82127;
        border-radius: 0 0 15px 15px;
        position: absolute;
        bottom: 0;
        transition: height 1s ease;
        z-index: 1;
    }

    .milestone {
        width: 112px; /* ~70% of previous width for a tighter line */
        height: 2px;
        top: auto;
        left: 50%; /* center horizontally on the bar */
        transform: translate(-50%, -50%);
        background: none; /* draw the rule with ::after to offset from label */
        position: absolute; /* overlay on top of the bar */
        z-index: 2;
    }

    .milestone::before {
        content: attr(data-label);
        position: absolute;
    left: 0;
        top: 50%;
        transform: translateY(-50%);
        font-size: 12px;
        color: #000;
        font-weight: bold;
    width: 24px;           /* fixed box for proper right-align near rule */
    text-align: right;      /* right-align left-side numbers */
    }
    .milestone::after {
        content: '';
        position: absolute;
        left: 28px;  /* gap after the left number */
        right: 28px; /* symmetric gap before the right labels */
        top: 50%;
        height: 2px;
        background: #000;
        transform: translateY(-50%);
    }

    /* Specific milestone positions for vertical layout */
    .milestone:nth-child(1) { bottom: 23.5%; }
    .milestone:nth-child(2) { bottom: 29.4%; }
    .milestone:nth-child(3) { bottom: 35.3%; }
    .milestone:nth-child(4) { bottom: 41.2%; }
    .milestone:nth-child(5) { bottom: 47.1%; }
    .milestone:nth-child(6) { bottom: 52.9%; }
    .milestone:nth-child(7) { bottom: 58.8%; }
    .milestone:nth-child(8) { bottom: 64.7%; }
    .milestone:nth-child(9) { bottom: 70.6%; }
    .milestone:nth-child(10) { bottom: 76.5%; }
    .milestone:nth-child(11) { bottom: 88.2%; }
    .milestone:nth-child(12) { bottom: 100%; }

    .milestone-amounts {
        height: auto;
        margin-top: 15px;
        position: relative;
        z-index: 3; /* labels above lines and fill */
    }

    .milestone-amounts span {
        position: absolute;
        display: block;
        text-align: left;       /* left-align right-side labels */
        transform: translateY(-50%); /* vertically center on the line */
        white-space: nowrap;
        left: calc(100% + 20px); /* add gap between line end and labels */
        font-size: 12px;
        color: #000;
        top: auto; /* will be set via JS to exact pixel center */
        bottom: auto; /* ensure CSS bottom:% doesn't interfere */
    }

    /* Specific milestone amount positions for vertical layout */
    .milestone-amounts span:nth-child(1) { bottom: 23.5%; }
    .milestone-amounts span:nth-child(2) { bottom: 29.4%; }
    .milestone-amounts span:nth-child(3) { bottom: 35.3%; }
    .milestone-amounts span:nth-child(4) { bottom: 41.2%; }
    .milestone-amounts span:nth-child(5) { bottom: 47.1%; }
    .milestone-amounts span:nth-child(6) { bottom: 52.9%; }
    .milestone-amounts span:nth-child(7) { bottom: 58.8%; }
    .milestone-amounts span:nth-child(8) { bottom: 64.7%; }
    .milestone-amounts span:nth-child(9) { bottom: 70.6%; }
    .milestone-amounts span:nth-child(10) { bottom: 76.5%; }
    .milestone-amounts span:nth-child(11) { bottom: 88.2%; }
    .milestone-amounts span:nth-child(12) { bottom: 100%; }

    /* EBITDA progress vertical */
    .ebitda-progress {
        margin-top: 40px;
    }

    .ebitda-bar {
        width: 30px;
        height: 350px; /* Increased from 200px for better mobile visibility */
        margin: 20px auto;
        border-radius: 15px;
        position: relative;
        overflow: visible;
    }

    .ebitda-fill {
        width: 100%;
        height: 0%;
        background-color: #e82127;
        border-radius: 0 0 15px 15px;
        position: absolute;
        bottom: 0;
        transition: height 1s ease;
        z-index: 1;
    }

    .ebitda-milestone {
        width: 112px; /* ~70% of previous width for a tighter line */
        height: 2px;
        top: auto;
        left: 50%; /* center horizontally on the bar */
        transform: translate(-50%, -50%);
        background: none; /* draw the rule with ::after to offset from label */
        position: absolute;
        z-index: 2;
    }

    .ebitda-milestone::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        font-size: 12px;
        color: #000;
        font-weight: bold;
    }

    .ebitda-milestone::after {
        content: '';
        position: absolute;
        left: 28px;  /* gap after the left number */
        right: 28px; /* symmetric gap before the right labels */
        top: 50%;
        height: 2px;
        background: #000;
        transform: translateY(-50%);
    }

    /* Specific EBITDA milestone positions for vertical layout */
    .ebitda-milestone:nth-child(1) { bottom: 12.5%; }
    .ebitda-milestone:nth-child(2) { bottom: 20%; }
    .ebitda-milestone:nth-child(3) { bottom: 32.5%; }
    .ebitda-milestone:nth-child(4) { bottom: 52.5%; }
    .ebitda-milestone:nth-child(5) { bottom: 75%; }
    .ebitda-milestone:nth-child(6) { bottom: 100%; }

    .ebitda-amounts {
        height: auto;
        margin-top: 15px;
        position: relative;
        z-index: 3;
    }

    .ebitda-amounts span {
        position: absolute;
        display: block;
        text-align: left;       /* left-align right-side labels */
        transform: translateY(-50%); /* vertically center on the line */
        white-space: nowrap;
        left: calc(100% + 20px); /* add gap between line end and labels */
        font-size: 12px;
        color: #000;
        top: auto;   /* will be set via JS to exact pixel center */
        bottom: auto; /* ensure CSS bottom:% doesn't interfere */
    }

    /* Specific EBITDA amount positions for vertical layout */
    .ebitda-amounts span:nth-child(1) { bottom: 12.5%; }
    .ebitda-amounts span:nth-child(2) { bottom: 20%; }
    .ebitda-amounts span:nth-child(3) { bottom: 32.5%; }
    .ebitda-amounts span:nth-child(4) { bottom: 52.5%; }
    .ebitda-amounts span:nth-child(5) { bottom: 75%; }
    .ebitda-amounts span:nth-child(6) { bottom: 100%; }

    /* Videos responsive */
    .videos-container iframe {
        flex: 0 0 100%;
        height: 225px;
        max-width: 400px;
        margin: 0 auto 15px auto;
    }

    /* Section padding adjustment */
    section {
        margin: 10px;
        padding: 15px;
    }

    /* Footer responsive */
    footer {
        padding: 15px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .tradingview-widget-container {
        height: 200px;
    }

    .videos-container iframe {
        height: 200px;
    }

    /* Smaller padding for very small screens */
    section {
        margin: 5px;
        padding: 10px;
    }
}
