
.dsex-cycle-page {
    background: #F2F6FC;
    padding: 10px;
}

.dsex-cycle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dsex-cycle-header h1 {
    margin: 0;
}

.dsex-cycle-header p {
    margin: 5px 0 0;
    color: #6b7280;
}

.dsex-cycle-header select {
    padding: 9px 14px;
    border: 1px solid #d9dde5;
    border-radius: 7px;
}


/* CARDS */

.cycle-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.cycle-card {
    border-radius: 10px;
    padding: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.cycle-card span {
    display: block;
    color: #6b7280;
    font-size: 13px;
}

.cycle-card strong {
    display: block;
    font-size: 20px;
    margin-top: 7px;
}

.cycle-card small {
    color: #9ca3af;
}


/* CHART */

.chart-card {
    border-radius: 10px;
}

.chart-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-top h2 {
    margin: 0;
}

.chart-top p {
    color: #6b7280;
    margin: 5px 0 0;
}

.legend {
    display: flex;
    gap: 20px;
    font-size: 13px;
}

.legend span {
    display: flex;
    align-items: center;
    gap: 7px;
}

.legend i {
    width: 20px;
    height: 3px;
    display: inline-block;
}

.actual-line {
    background: #2563eb;
}

.cycle-line {
    background: #10b981;
}

#chartMessage {
    display: none;
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

#dsexCycleChart {
    width: 100%;
    min-height: 420px;
}


/* METHODOLOGY */

.method-card {
    margin-top: 20px;
    padding: 20px;
    border-radius: 10px;
}

.method-card h3 {
    margin-top: 0;
}

.warning {
    background: #f5f1ff;
    padding: 12px;
    border-radius: 7px;
    color: #5b21b6;
}


/* BACKTEST */

.backtest-card {
    margin-top: 20px;
    padding: 0px;
    background: #F2F6FC;
    border-radius: 10px;
}

.backtest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.backtest-header h2 {
    margin: 0;
}

.backtest-header p {
    color: #6b7280;
}

#loadBacktest {
    border: 0;
    padding: 9px 16px;
    border-radius: 7px;
    background: #7d2eff;
    color: white;
    cursor: pointer;
}

.table-wrapper {
    overflow-x: auto;
    margin-top: 15px;
}


/* RESPONSIVE */

@media(max-width: 1000px) {

    .cycle-stats {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media(max-width: 600px) {

    .dsex-cycle-page {
        padding: 10px;
    }

    .dsex-cycle-header {
        display: block;
    }

    .dsex-cycle-header select {
        margin-top: 10px;
    }

    .cycle-stats {
        grid-template-columns: 1fr;
    }

    .chart-top {
        display: block;
    }

    .legend {
        margin-top: 15px;
    }

}

/* =========================================================
   METHODOLOGY
========================================================= */

.method-card {
    margin-top: 24px;
    padding: 28px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.method-card h3 {
    margin: 0 0 18px;
    font-size: 22px;
}

.method-card > p {
    color: #4b5563;
    line-height: 1.7;
}

.method-step {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid #edf0f5;
}

.method-step h4 {
    margin: 0 0 10px;
    font-size: 17px;
}

.method-step p {
    color: #4b5563;
    line-height: 1.7;
    margin-bottom: 12px;
}

.method-example {
    margin: 14px 0;
    padding: 14px 16px;
    background: #f7f8fc;
    border-left: 4px solid #7d2eff;
    border-radius: 6px;
    line-height: 1.8;
}

.formula-box {
    margin: 16px 0;
    padding: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    line-height: 1.8;
}

.warning {
    margin-top: 28px;
    padding: 16px 18px;
    background: #fff8e6;
    border: 1px solid #f1d48a;
    border-radius: 8px;
    color: #6b4f00;
    line-height: 1.7;
}

.method-summary {
    margin-top: 28px;
    padding: 18px;
    background: #f2f6fc;
    border-radius: 8px;
    line-height: 1.7;
}

.method-summary p {
    margin: 8px 0 0;
    color: #374151;
}

/* =========================================================
   SIMILARITY
========================================================= */

.similarity-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 16px;
    margin-top: 16px;
}

.similarity-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
}

.similarity-card span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 8px;
}

.similarity-card strong {
    display: block;
    font-size: 25px;
    margin-bottom: 5px;
}

.similarity-card small {
    color: #9ca3af;
}


/* =========================================================
   COMPOSITE LEGEND
========================================================= */

.composite-line {
    display: inline-block;
    width: 24px;
    height: 3px;
    margin-right: 6px;
    vertical-align: middle;
    background: #7d2eff;
    border-radius: 3px;
}


/* =========================================================
   METHOD
========================================================= */

.method-card {
    margin-top: 24px;
    padding: 10px;
    background: #F2F6FC;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.method-card h3 {
    margin: 0 0 18px;
    font-size: 22px;
}

.method-card > p {
    color: #4b5563;
    line-height: 1.7;
}

.method-step {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid #edf0f5;
}

.method-step h4 {
    margin: 0 0 10px;
    font-size: 17px;
}

.method-step p {
    color: #4b5563;
    line-height: 1.7;
    margin-bottom: 12px;
}

.method-example {
    margin: 14px 0;
    padding: 14px 16px;
    background: #fff8e6;
    border-left: 4px solid #7d2eff;
    border-radius: 6px;
    line-height: 1.8;
}

.formula-box {
    margin: 16px 0;
    padding: 18px;
    background: #fff8e6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    line-height: 1.8;
}

.warning {
    margin-top: 28px;
    padding: 16px 18px;
    background: #fff8e6;
    border: 1px solid #f1d48a;
    border-radius: 8px;
    color: #6b4f00;
    line-height: 1.7;
}

.method-summary {
    margin-top: 28px;
    padding: 18px;
    background: #f2f6fc;
    border-radius: 8px;
    line-height: 1.7;
}

.method-summary p {
    margin: 8px 0 0;
    color: #374151;
}


/* =========================================================
   BACKTEST
========================================================= */

.backtest-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 18px 0;
}

.backtest-method-summary {
    padding: 12px 16px;
    background: #f7f8fc;
    border-radius: 7px;
    border: 1px solid #e5e7eb;
}

.backtest-summary small {
    width: 100%;
    color: #6b7280;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {

    .similarity-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 700px) {

    .cycle-stats {
        grid-template-columns: 1fr 1fr;
    }

    .method-card {
        padding: 20px;
    }

}